Computer Science, asked by bhuvirat, 1 month ago

The correct order of the declarations in a Java program is
Select one:
O a.Class declaration, import statement, package declaration
O b.Import statement, package declaration, class declaration
O c.Package declaration, import statement, class declaration
O d. Import statement, class declaration, package declaration.

Answers

Answered by divyakanwar91200
3

Answer:

c

Explanation:

first the package name is defined then the import statement if any and then the class declaration goes on

Answered by Hansika4871
0

The correct order of the declarations in a Java programme is package declaration> import statement> class declaration (option c).

  • A declaration statement is a sort of Java statement that is used to define a variable by naming it and describing its data type.
  • Declaring a variable is the same as creating one. We must inform Java of the type and name of the variable before it can be created.
  • The package name is defined first. Then, if there are any, the import declarations. After that, the class declaration continues.

Similar questions