-
Which of the below is true about java class structure?
-
- The class should only contain those attribute and functionality which it should; hence keeping it short
- The class attributes and methods should be public
- The class should have thousands of lines of code
- The class name should start with lowercase
- 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.