Java technology is both a programming language and a platform.
The Java is both compiled and interpreted
The Java platform has two components:
Java is platform independent language
Java does not support multiple inheritance
Sample Program:
public class Sample{ public static void main(String[] args) { System.out.println("Hello World!"); } }
The main method controls the flow of the program.It should be declared as public and static so that it can be called direclty without instaniating it.
main
class Sample2{
}
This program will compile but it will not run.Since there is no main function defined in this class
comments in Java:
// single line
/* multiple
Line*/
/**
documentation comment
*/