Java, .NET, PHP, PYTHON, ANGULAR, ML, Data Science, Testing, CI Tutorials in Easy Languages.

"Best Software Training, Internship, Project Development center of Indore India, Helpline 780506-3968"

---Program Explanation of Java---




class Hello
{
   public static void main(String abc[])
   {
       System.out.println("hello world");

   }

}

//class is the blueprint of the object, it is used to define the functionality of the object using data member and member function. we can define a single object and multiple objects definition both using class.

{}   --->  it is called token of class which is used to define block, all block-level statement will be defined by this. for example if-else, switch, loop, function, etc


public:-   it is an access specifier or access modifier that is used to define the scope of the data member, member function, and class, the public can be accessible outside of the project, package, method, and class.


static:- it is called a non-access modifier of java that provides compile-time memory allocation means if we create a static variable then it's memory will be fixed but a value can be changed, static variable and method will be called without any object.


void:-  it is a datatype which returns the null value in java.

main():-   it is a predefined entry-point function that will be mandatory for program execution.main() always will be declared static because it will be called without any object.implicit.

String args[]:- args is the argument which is used to contain String array type data using the command line, if we want to pass data from command line input then it will work. String type array is mandatory in the main() as a parameter.

args is the user define identifier, it names can be changed.


System:-  It is the predefined class of java that exists under java.lang package .it is used to handle input /output operation using Java.

out:-   It is the reference of PrintStream class which is used to print statements using print() or println().

print() or println():-  It is used to print output data of java. It is the method of the PrintStream class.


"hello world":-  It is String type literals

;   it means the end of the statement













next :- blogger.com/blog/post/edit/7768209714160124788/9015432222536123854

2 Comments

If you have any doubt in programming or join online classes then you can contact us by comment .

  1. solution of area of tringle using heron's formula.
    public class Main
    {
    public static void main(String[] args) {
    int a=3,b=4,c=5;
    int s;
    s=(a+b+c)/2;
    int r;
    r=s*(s-a)*(s-b)*(s-c);
    System.out.println(Math.sqrt(r));
    }
    }

    ReplyDelete
  2. Command Line

    class Terminal
    {
    public static void main(String args[])
    {
    System.out.println(args[0] + " "+ args[1]);

    }

    }

    ReplyDelete

Post a Comment

If you have any doubt in programming or join online classes then you can contact us by comment .

Previous Post Next Post