Java programming structure

dhavalkurkutiya

Dhavalkurkutiya

Posted on September 25, 2022

Java programming structure

Java Programming Structure

A java programming structure consists 6 major section:

  1. Document Section
  2. Package Statement
  3. Important Statement
  4. Interface Statement
  5. Class Defination and ,
  6. Main Method Definition inside main class [ESSENTIAL]

1. Document Section šŸ“‘

This section includes to comments to tell tha program's purpose, it improves readability of tha program.

2. Package Statement šŸ˜

A Package Statement allowed to includes statement that provides a package declaration.

3. Important Statement šŸ§‘ā€šŸ’»

In C or C++ if we require to include some external libraries in our program then we use "include" statement, similar java using "import" statement we can use external libraries in our program, it includes statements used for referring classes and interfaces that are declared in other packages.

4. Interface Statement šŸ’«

In Java language, an interface can be defined as a contract between objects on how to communicate with eachother, this is similar to class but only includes constants, method declaration, allowed to declare interface.

5 . Class Defination šŸ§‘ā€šŸ’¼

It describes information about user defines classes present in the program, this Section allowed to user able to declared other user defined class above ther main method class.

6. Main Method Definition inside class šŸ¤—

Java Program Execution starts form main method, it Consists main method definition inside class.

šŸ§‘ā€šŸ’» Basic java program šŸ§‘ā€šŸ’»

class Main{
  public static void main (String[] args) {
    System.out.println("Hello World");
  }
}
Enter fullscreen mode Exit fullscreen mode

šŸ‘‡ Check out šŸ‘‡

ā¤ļø Instagram : https://www.instagram.com/_mr.dhaval_io
šŸ‘„ Facebook : https://m.facebook.com/dhaval.kurkutiya.3
šŸ¦ Twitter : https://www.twitter.com/dhaval87950061

šŸ’– šŸ’Ŗ šŸ™… šŸš©
dhavalkurkutiya
Dhavalkurkutiya

Posted on September 25, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

Java programming structure
java Java programming structure

September 25, 2022