Lecture-1 Basic Structure Of The Java Program


Basic Structure of a Java Program consists of 2 things :

  1 FUNCTIONS
  2 CLASSES

" A function can be defined as a method to do only one particular task while class is defined as a combination of many functions in a single frame. for more information please watch this video till end."

EASY ANALOGY EXPLAINED :

Explaination of the Classes and methods in a single frame:

Suppose you went into a car factory , then the class name is that factory name in our case suppose tesla is a factory name and many methods are running in the factory to attain the best productivity and efficiency are called functions , many functions such as "Making Tesla Body" and then "Engine work is done here" then "Wheel alignment is done" along with "Paint Job" and atlast "testing of that car is done" , so these are the basic diffrence between class and function defined in a  class.

Meaning of Java Program Written Below:

public : This is an access modifiers ("public") which can be accessed anywhere in a class
Sachin : This is a class name , you can give name as per your requirements.
void : void means Null ("Kuch nahi") , it will not return anything.
main : It is the main function
static : static is a reserve keyword which stated that you can access this class without making any object. 
String args[] : It is an array of strings passed as parameter when you are running your application through command line in the O.S.

Naming Conventions in Java Programming language

How a name should be given to a particular class or a function is called naming convension


                                                                                                                                        Next Page>>

Code Snippet of our First Java Program 
 
public class Sachin{
    public static void main(String args[]){
            // code can be written here
            System.out.println(" Welcome to ClassGenix ");
            }
    }