The basic structure of the java program.

  • Documentation section.
  • Package statement
  • Import statement
  • Interface statement
  • Classes definition
  • Main method of classes


The documentation system is basic information about the program.
In this section, you can write the comments of the program.
A comment is important  for the program because it helps the java program to understand better
This basic information of the program written in the form of a comment. There are three types of comment in java programming  first is

1-  //………………… text it ignores the multiple lines.
2- /*……. Text.. */                          it ignores the block of code
3- /** …text……………*/                  it ignore the  block of code.

 The documentation system is optional.


package created with any name in the program.
Package consist of a group of classes that are defined by any name .if you declare many classes in the program With one element then you can declare it with package .but if you not declare the classes within the package there will be no problem. It used like that package is a keyword.
Package student
It is optional.

Import is used for the import of the class in the program.
If you go use the class of another package then you can do it by importing it directly in your program.
For example, is
Import test. student.

The interface statement
is optional.
if we need to insert multiple inheritances in the program then needs to the interface statement.
The interface is like classes but in which we insert method .but mostly used for the insert the multiple inheritances in java program it is optional.

Class definition

It means if we used multiple classes in my program it is defined in this section.
Main class definition.

In which defined the main method
Every java program needs to the main method in the starting of the program.
It is necessary for the program.

The main method of program
It is most important in the java program.

it is essential.


Nested if else statement
If else statement in java
If statement in java
A simple program in java for begnners
 System.out.printin() in java
Public static void main ( String args[] ) in java program.
The basic structure of the java program.
Data types in java with examples(write and video tutorial
what is JVM(java virtual machine) java 8 features
What is Java programming and java history

Post a Comment