Object - Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behaviors -wagging, barking, eating. An object is an instance of a class.
Class - A class can be defined as a template/ blue print that describes the behaviors/states that object of its type support.
Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.
Instance Variables - Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables.
Class - A class can be defined as a template/ blue print that describes the behaviors/states that object of its type support.
Methods - A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.
Instance Variables - Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables.
First Java Program:
public class MyFirstJava {
public static void main(String[] args) {
System.out.println("Hello Java");
}
}
Error :
Solution :
public static void main(String[] args) {
System.out.println("Hello Java");
}
}
Error :
Could not find or load main class HelloWorldApp.class
A common mistake made by beginner programmers is to try and run the
java launcher on the .class file that was created by the compiler. For example, you'll get this error if you try to run your program with java HelloWorldApp.class instead of java HelloWorldApp. Remember, the argument is the name of the class that you want to use, not the filename.
This solution is work for me, make your paths in system variables - like this