Java Program Structure

A Java program may contain many classes of which only one class defines the main method. Classes contain data members and methods that operate on the data members of the class. Methods may contain data type declaration and executable statements. To write a java program, we first define classes and then put them together. A Java program may contain one or more section are shown as following in Fig:

Recommended Posts:

    1. Features of Java
    2. Java Program Structure
    3. Command Line Arguments in Java
    4. Difference between java and c++
    5. Data Types in Java with example
    6. Scope of Variables in Java
    7. Operators in Java
    8. Looping Statement in Java
    9. Objects and Classes in Java
    10. Constructors in Java with example
    11. Method Overloading in Java with example
    12. Method Overriding in Java with example
    13. Static Members in Java with Program
    14. Abstract Class in Java with Program
    15. final, finally and finalize in Java
    16. Dynamic Method Dispatch in Java | Runtime Polymorphism
    17. Nesting of Methods in java
    18. Inheritance in Java with example
    19. Java Access Modifiers – Public, Private, Protected, Friendly
    20. Array in Java
    21. Strings in Java | String Methods
    22. StringBuffer class in Java with Program
    23. Vector in Java | Vector Methods
    24. Wrapper Classes in Java With Program
    25. Autoboxing and Unboxing in Java With Program
    26. enum in Java with Program
    27. Java Annotation
    28. Interface in Java with Program
    29. Difference between Class and Interface in Java
    30. Implementing Interfaces in Java
    31. Java Program to implement Multiple Inheritance using Interface
    32. Difference Between Multithreading and Multitasking in Java
    33. Life Cycle of Thread in Java with Diagram
    34. Synchronization of threads in Java
    35. Java Thread Priority
    36. Java Program to Implement Multithreading using Runnable Interface
    37. Inter-thread Communication in Java
    38. Suspend, Resume and Stop Thread in Java
    39. Types of Error in Java
    40. Exceptions in Java
    41. Exception Handling in Java with examples
    42. Java Package
    43. Static import in Java
    44. Design a package to contain class Student and package contain interface Sports