Ok here what I did,
Renamed the program to Lamp. Now the program name and the class name is same.
Removed the calltomethod class as it was not required. Compiled the c
class Lamp{
//define behaviour
int brightness = 0;
void changebrightness(int newvalue){
brightness = newvalue;
}
void printstates(){
System.out.println(" Brightness: " +brightness);
}
public static void main(String[] args) {
Lamp lamp1 = new Lamp();
lamp1.changebrightness(10);
lamp1.printstates();
}
}
And it works now.
I thank you Sean and everyone for being so responsive. This place is great for newbies.
FJ.