I'm trying to make different classes and make instances in the main class then run the program just that simple, but i get this error:
shka.java:4: error: cannot find symbol
ahmed c = new ahmed("Shika");
^
symbol: class ahmed
location: class shka
shka.java:4: error: cannot find symbol
ahmed c = new ahmed("Shika");
^
symbol: class ahmed
location: class shka
2 errors
error: compilation failed
And here is the code shka.java:
public class shka {
public static void main(String[] args) {
System.out.println("Starting.. ");
ahmed c = new ahmed("Shika");
// c.name = "Shika";
System.out.println(c.name);
}
}
ahmed.java:
public class ahmed {
public String name;
// Constructor
// This = self in python
public ahmed(String name) {
this.name = name;
}
public void msg() {
String h = "BATTA";
System.out.println("HELLO, " + h + " This is the other class");
}
}