Skip to main content

Structure of Java Program

Structure of Java Program

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.
structure of java program
  • 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.


Comments

Popular posts from this blog

Introduction To C++

       Lets learn The C++ Programming Language C++ ranks 4th in popularity according to 2016 IEEE spectrum Top Programming Language ranking. Learning C++ is a wise investment for all programmers.                    What is C++? “C++ is a statically-typed, free-form, (usually) compiled, multi-paradigm, intermediate-level general-purpose middle-level programming language.” In simple terms, C++ is a sophisticated, efficient and a general-purpose programming language based on C. It was developed by Bjarne Srroutrup in 1979. Many of today’s operating systems, system drivers, browsers and games use C++ as their core language. This makes C++ one of the most popular languages today. Since it is an enhanced/extended version of C programming language, C and C++ are often denoted together as C/C++.                                “Hello World!” Your first C++ program will be a “Hello World!” program. You might have noticed “Hello World!” being the first program while starting

Java Basic Principles

This Blog is Specially Designed for those who can learn the theory concepts of Java (Object Oriented Language)                                                             Object Oriented programming is a programming style which is associated with the concepts like class, object, Inheritance, Encapsulation, Abstraction, Polymorphism. Most popular programming languages like Java, C++, C#, Ruby, etc. follow an object oriented programming paradigm.  As JAVA  being  the most sought-after skill, we will talk about object-oriented programming concepts in Java.   An object-based application in Java is based on declaring classes, creating objects from them and interacting between these objects.  In this blog,  we will understand the below  core concepts of  Object oriented Programming in the following sequence: Inheritance Encapsulation Abstraction Polymorphism Object Oriented Programming : Inheritance In OOP, computer programs are designed in such a way where everything is an

C++ Operators

                                                               Operators Once introduced to variables and constants, we can begin to operate with them by using operators. What follows is a complete list of operators. At this point, it is likely not necessary to know all of them, but they are all listed here to also serve as reference. Assignment operator (=) The assignment operator assigns a value to a variable.   x = 5; This statement assigns the integer value  5  to the variable  x . The assignment operation always takes place from right to left, and never the other way around:   x = y; This statement assigns to variable  x  the value contained in variable  y . The value of  x  at the moment this statement is executed is lost and replaced by the value of  y . Consider also that we are only assigning the value of  y  to  x  at the moment of the assignment operation. Therefore, if  y changes at a later moment, it will not affect the new value taken by  x . For exampl