Structure of a java program is the standard format released by Language developer to the Industry programmer.
Sun Micro System has prescribed the following structure for the java programmers for developing java application.
- A package is a collection of classes, interfaces and sub-packages. A sub package contains collection of classes, interfaces and sub-sub packages etc. java.lang.*; package is imported by default and this package is known as default package.
- Class is keyword used for developing user defined data type and every java program must start with a concept of class.
- "ClassName" represent a java valid variable name treated as a name of the class each and every class name in java is treated as user-defined data type.
- Data member represents either instance or static they will be selected based on the name of the class.
- User-defined methods represents either instance or static they are meant for performing the operations either once or each and every time.
- Each and every java program starts execution from the main() method. And hence main() method is known as program driver.
- Since main() method of java is not returning any value and hence its return type must be void.
- Since main() method of java executes only once throughout the java program execution and hence its nature must be static.
- Since main() method must be accessed by every java programmer and hence whose access specifier must be public.
- Each and every main() method of java must take array of objects of String.
- Block of statements represents set of executable statements which are in term calling user-defined methods are containing business-logic.
- The file naming conversion in the java programming is that which-ever class is containing main() method, that class name must be given as a file name with an extension .java.
- Write a Java program to print 'Hello' on screen and then print your name on a separate line.
- Write a Java program to print the sum of two numbers.
- Write a Java program to divide two numbers and print on the screen.
- Write a Java program to print the result of the following operations.
- Write a Java program that takes two numbers as input and display the product of two numbers.
- Write a Java program to print the sum (addition), multiply, subtract, divide and remainder of two numbers.
- Write a Java program that takes a number as input and prints its multiplication table upto 10.
- Write a Java program to display the following pattern.
- Write a Java program to print the area and perimeter of a circle.
- Write a Java program that takes five numbers as input to calculate and print the average of the numbers.
- Write a Java program to print the area and perimeter of a rectangle.
- Write a Java program to print an Indian flag on the screen.
- Write a Java program to swap two variables.
- Write a Java program to print a face.
+"""""+ [| o o |] | ^ | | '-' | +-----+
- Write a Java program to add two binary numbers.
- Write a Java program to multiply two binary numbers.
No comments:
Post a Comment