Java - Introduction:- Java is an object-oriented applications programming language developed by Sun Microsystems in the early 1990s. Java applications are typically compiled to bytecode, although compilation to native machine code is also possible. At runtime, bytecode is usually either interpreted or compiled to native code for execution, although direct hardware execution of bytecode by a Java processor is also possible.
The language itself derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities. JavaScript, a scripting language, shares a similar name and has similar syntax, but is not directly related to Java.
Sun Microsystems provides a GNU General Public License implementation of a Java compiler and Java virtual machine, in compliance with the specifications of the Java Community Process, although the class library that is required to run Java programs is not free software.
At first Java is Started as a Project called "Oak".
The first public implementation was Java 1.0 in 1995.
Java is Plat Form Independence Language.
The Java program is converted into byte code at run time and then is called as Java bytecode.
Then the Java byte code is converted into Machine code by JIT compiler.
Java programs are runned using the JDK (Java Development Kit).
Get Started Java:-
The given below show the example for a simple java program. The Program is :-
public class Hello { public static void main(String[] args) { System.out.println("Hello, World!"); } }
In the above:- public = visibility modifier class = a keyword used to specify the class name. Hello = name of the class void, string = datatype main() = method name of function name args = arguments or parameter passed to the main function System.out.println = it calls the method "println()" called from the "out" class which is inside the "System" class. Generals Rules for Java Program:-
The name of the class and name of the java file must be same.
The main() function must be present in each and every java program except Applets.
The function should return a value when using the datatypes except void datatype.
Each and every function used in the program must be called inside the main() function.
The name of the function used inside the program must be Unique.
There is no limits for the function and class to use in the program.