Java Techies - Solution for All
Java Techies - Solution for All
Source : create a source document. Use an
established protocol.Compiler : Run your document through a source
code compiler.The Compiler checks for errors and won't let you
compile until it's satisfied that everything will run correctly.output: The compiler creates a new document
coded into Java bytecode. Any device capable of running Java will
be able to interpret/translate this file into something. It can
run. The compiled bytecode is platform-independent.Virtual Machines: Your friends don't have a
physical Java Machine but they all have a virtual Java Machine
(implemented in software) running inside their electronic gadgets.
The Virtual machine reads and runs the bytecode.Step -1 Write Source Code
class Test{
public static void main(String args[]){
System.out.println("Hello Java !");
}
}
Step- 2 Save Code with class Name
Step-3 Compile the code
Note:when you compile the code it will generate an intermediate code (Byte code) it is not a machine code.
Step-4 run the Program
Note:Running the program by starting the JVM with the A.class. The JVM translates the bytecode into something the underlying platform understands , and runs your program.
OUTPUT
We can observe our program that how it executes and what steps are done by the JVM to run Java program.
class that
is at the command line. Then it starts looking for a specially
written method that looks exactly like:
public static void main(String args[])
{
/* Your Code Here */
}
Note: Every Java application have at least one class, and at least one main method.
public static void main(String args[]){}
static public void main(String args[]){}
/* Allowed in JDK 1.5 or higher */
public static void main(String ...a){}
/* Allowed in jdk1.5 or higher */
static public void main(String ...a){}
public , because java is package centric
language.outside
package. That's why it set to as public.static , because static is loaded on
the compile Time and not required to instantiate.void , because it is not required to
return any thing to the JVM. and String args[] is used for
command line arguments , where String is a Java class.
final class, found in java.lang package.
Out is a object of PrintStream class and it declare static in the
System Class.PrintStream class. Used to print on console and print in new lineClass and Interfaces : The First letter should
be capital, and first letter of the inner words should be Capital.Example :
Methods: The First Letter should be lowercase,
and then normal camelCase rules should be used.Example :
Variables : Same rule as Method Rule ,Variables follows camelCase rules.Example :
Constants : Same rule as Method Rule Constants
All in Uppercase.Example :


