Home » JAVA Programming » Java Basic » Question
  1. Which of the below is true about java class structure?
    1. The class should only contain those attribute and functionality which it should; hence keeping it short
    2. The class attributes and methods should be public
    3. The class should have thousands of lines of code
    4. The class name should start with lowercase
    5. None of these
Correct Option: A

Class name should always start with upper case and contain those attribute and functionality which it should (Single Responsibility Principle); hence keeping it short. The attributes should be usually private with get and set methods.



Your comments will be displayed only after manual approval.