Java Program Explanation With Program

Explain Java Program With Theory & Details
You had seen on my previous post a "Simple Java Program Writing" how to write java program.

In that program you see lots of keywords, what does that meanings, why we are using.
Now i am gonna explain you every step meaning

https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4MZhh7qz0sMBl9_obfkfX1ZNvU68Xnzh0Q5BkD0T8eUX2IahAf29A-rdtgbyeEmDJru9PenuMxHOSLAP61BFHzXqsQzNrAczB47Yby3Y5zg_9hXceqE59A4vN2ywCAFCoypXocm2H094/s1600/rsz_campusnikalo_zpse94f2923.jpg 1. You know we need to create class for writing class, so we are giving the name of the class as SimpleExperiment and make it as a public so we can use anywhere.
Ex: public class SimpleExperiment

2. Then we declare the method as a static
Java allows us to define a class within another class. Such a class is called a nested class. The class which enclosed nested class is known as Outer class. In java, we can’t make Top level class static. Only nested classes can be static.  That's why onlu main class declare as a static.
For Ex: public static void main(String args[])
Then we need to pass Argument so for that we take args[] as a argument and in main method we pass.
For Ex: Public static void main(String[] args).

3. Then in between { & } we write down the code for printing the messasge.
For Ex:   {
        // TODO code application logic here
        System.out.println("Java Programming Tutorials");
     }


Then Close class closing braces  and now your program is ready.


Learn How To Run Java Program In Next Post...
Thanks

Why java declare as a static, why class declare as a public, How to print message in java




Labels: