Surfe.be - passive income
Surfe.be - passive income

Five basic parts of a basic java program

Five basic parts of a basic java program


Five basic parts of a basic java program

Part of a basic Java program: In the Java program, we can define more than one category as per the requirement. But still we can define the main () method in any one class in a program. Various types of data and those tasks performed on those data are defined in different classes. To create Java programs, we first create different types of classes and then add those classes. We can show different departments of a Java program as follows:

Documentation section
Package Details
Import details
Interface Details
Classroom definitions                           
Five basic parts of a basic java program
{
Data member
Ways
Main law group
{
Main method definitions
}
}


Documentation section

In this section of any program, we will have to give details related to the program. We have to write about the author's name, the name of the program, the reason for creating the program, the usefulness of the program, etc. We have to write in the documentation section as a comment. Although this is an optional section, we must properly document every program to make the program as readable.

Here we have to tell which classes we have used in the program and for what reasons we have used them. In addition, the program's algorithm i.e. should also try to describe the flow in summary form. Generally speaking for the document / **. . . * / Should be written in the form Commenting this way, we can generate a file using the documentation JDK tool.

Package Details

Package statement is the first statement of any Java program. This statement declares the name of a package and tells the Java program that the classes used in the program are defined in these packages. We can use a package in Java's source program like this:

Package Student Information

This statement will include the Package named Student Information in that Program or Source File, in which the Statement has been written.


Import Statements

The next statement that can be done after a package statement is the import statements. To include a previously created class in Java's Source Program, we have to write the name of the class with Java's Import Keyword, which has to be used in our program. We can do this by Statement as follows:

import Student Information.test Marks;

This statement gives Java Interpreter the message to include class Class Test Marks in the Source File, which is available in the Package named Student Information and is a part of this package.

Interface Statements

Interface is similar to a class, but it has a group of Declarations of Methods. This is also an Optional Statement and we only use it when we have to get Multi Inheritance facility in our program. In this subject we will read further in detail.


Main Method Class

In every application program in Java, we need a Main () method, which Java Complete does the first Execute. This is a very important part of any Java application program. This can only be a method in a simple Java program. Main Method Creates Objects of Different Types of Classes and Establish Communication between them. Upon reaching the end of the main method, the program terminate and Program Control becomes a transfer to the operating system.
Five basic parts of a basic java program Five basic parts of a basic java program Reviewed by Raj Aryan on July 10, 2019 Rating: 5

1 comment:

Powered by Blogger.