Structure of Java program
Structure of Java program
The fundamental structure of java is :
[package declarations]
[import statements]
[class declaration]
-package declaration is specifies the package or source folder of the java projects in
which we are working.
eg : package p1
-import statement is used the in-built java packages or user created pckages.
eg : import java.lang
The default package of java is :
java.lang
we will discuss about packages later in the tutorials.
-class declaration :
Every java program starts with class keyword. Class declaration is the class that you
declare in your program.
Example :
package p1;
import java.lang;
class Test
{
public static void main(String args[])
{
System.out.println("This is java");
}
}
Output :
This is java
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment