Hiiiiii... am back to tell what is?
ok see the code once again (not the C O D E ):
C O D E:
package com;
public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}
}
we called this (Public, Private, Protected) access modifiers ...and also this is a keyword so we can not use this as variable. I hope you know what is variables if you are not I do not care ha ha ha...
Public is like Public, a variable or method is public means that can access by any class
Ex:--
public int a;
this is a public variable this variable can access from anywhere form your entire application so we called this as global variable
{
}
This is called class , it can be defined as template it describes the object behaviours
Object is an instance of a class it has its own states and behaviours.
ok yaaarrr now I can understand what is class but inside the class something is there what is that?
public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}
}
This is what we called method, a class can contain many method u can c d keyword main so this is main method. It is always public because it has to be accessed by the runtime.
yaa u can create your own method inside the class ... but listen you method name should start with smaller case (naming conversion).
for example:
public class HelloJavaClassName
{
public void shouldStartWithSmallCase()
}
this is called method name shouldStartWithSmallCase()
Static is also keyword, if You use static keyword to the variable that variable value is static to the entire application.
public class HelloJavaClassName
{
static int pi=3.14159265358979323846264338327950288419716939937510582097494459230781640
}
The pi value is, Oh! sorry you can use 3.14 this value never going to change so we can declare this pi variable as static, for your entire program the pi value is 3.14 only this is we called static variable
static variable gets memory once at the time of class loading...
oKeY! why we use public static void main(String []args) ?
This is the main function, any doubt on that if any read from first. Main function should run first , the static keyword trigger the main function for first execution. so every program started to run from main class. That means main class always run first.
I know it is little bit difficult to understand study about array and data type then u can understand little bit more...
ok see the code once again (not the C O D E ):
C O D E:
package com;
public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}
}
what is public?
public class HelloJavaClassNamewe called this (Public, Private, Protected) access modifiers ...and also this is a keyword so we can not use this as variable. I hope you know what is variables if you are not I do not care ha ha ha...
Public is like Public, a variable or method is public means that can access by any class
Ex:--
public int a;
this is a public variable this variable can access from anywhere form your entire application so we called this as global variable
oK dude! what is
public class HelloJavaClassName{
}
This is called class , it can be defined as template it describes the object behaviours
ok then what is object ?
Object is an instance of a class it has its own states and behaviours.
ok yaaarrr now I can understand what is class but inside the class something is there what is that?
public class HelloJavaClassName
{
public static void main(String []args)
{
System.out.println("Hello World");
}
}
This is what we called method, a class can contain many method u can c d keyword main so this is main method. It is always public because it has to be accessed by the runtime.
yaa u can create your own method inside the class ... but listen you method name should start with smaller case (naming conversion).
for example:
public class HelloJavaClassName
{
public void shouldStartWithSmallCase()
}
this is called method name shouldStartWithSmallCase()
What is static?
Static is also keyword, if You use static keyword to the variable that variable value is static to the entire application.
public class HelloJavaClassName
{
static int pi=3.14159265358979323846264338327950288419716939937510582097494459230781640
}
The pi value is, Oh! sorry you can use 3.14 this value never going to change so we can declare this pi variable as static, for your entire program the pi value is 3.14 only this is we called static variable
static variable gets memory once at the time of class loading...
oKeY! why we use public static void main(String []args) ?
This is the main function, any doubt on that if any read from first. Main function should run first , the static keyword trigger the main function for first execution. so every program started to run from main class. That means main class always run first.
what is void ?
This method just print helloworld so we are not going to return any value here, void means that the method has no return value.what is string args[]?
string and args is keyword ,java takes every values as string so we use the data type string.args[] is argument array of console line values stored in the [] array argument.I know it is little bit difficult to understand study about array and data type then u can understand little bit more...
what is system.out.println()?
what is class? what is package(check on previous post)? what is method?
If you know the answer for the previous questions then you can understand system.out.println
System is a class in the package of java.lang
out is the instance of java.io.PrintStream
println is the methosd of java.io.PrintStream
This will help to print the output......