Which of the below is true about java class structure?
(a) The class name should start with lowercase
(b) The class should have thousands of lines of code
(c) The class should only contain those attribute and functionality which it should; hence keeping it short
(d) The class attributes and methods should be public
(a) The class name should start with lowercase
(b) The class should have thousands of lines of code
(c) The class should only contain those attribute and functionality which it should; hence keeping it short
(d) The class attributes and methods should be public
Right option is (c) The class should only contain those attribute and functionality which it should; hence keeping it short
For explanation I would say: 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.