मराठी

Define the structure of a JAVA program.

Advertisements

प्रश्न

Define the structure of a JAVA program. 

व्याख्या
Advertisements

उत्तर

  1. Documentation Section: This section contains comments that describe the program, its purpose and other important information.
  2. Package Statement: It is used to declare the package to which the Java class belongs. It helps in organizing related classes.
  3. Import Statement: It is used to include predefined classes and packages required in the program.
  4. Class Declaration: Every Java program contains at least one class. A class is declared using the class keyword and contains variables and methods.
  5. Main Method: The main() method is the starting point of execution in a standalone Java application. It is declared as public static void main(String[] args).
  6. Program Statements: These are instructions written inside methods to perform specific tasks such as calculations, input and output operations.

Input:

import java.util.*;
class Hello
{
    public static void main(String[] args) 
    {
        System.out.println("Hello Java");
    }
}

Output:

Hello Java

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 3: Programming in Java (Review of Class XI Sections B and C) - EXERCISE [पृष्ठ ९८]

APPEARS IN

धीरज मेहरोत्रा Computer Science [English] Class 12
पाठ 3 Programming in Java (Review of Class XI Sections B and C)
EXERCISE | Q 16. | पृष्ठ ९८
Advertisements
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×