Skip to main content

Posts

Showing posts with the label Java Programe Structure

Java Programe Structure

 Java Programe Structure     Java class contains may classes but only one class contain main method. Class contain data members and methods that operate on the data members of the class. Method may contend data type declaration and executable statements. To write program, we first need to define classes and then put them together. A java may contain one or more sections. Document Section:     The documentation section comprises a set of comment lines giving the name of programes, author details and other details of program. Comments must explain why and what are the cases. This will help in maintaining the program. For single line comment comment programer will use ' // ' forword slash and for multiline comment programer will use ' /* */ ' syntax. Package Statement:     The first statement allowed in a java file is Package statement. This statement declares a package name and inform the compiler that class defined here belong to this package. For ex...