in Education by
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 I have been asked this question during an interview for a job. Enquiry is from Coding best practices in division Autoboxing & Miscellaneous of Java Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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.

Related questions

0 votes
    Which of the following is not true about Java beans? (a) Implements java.io.Serializable interface (b) ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the below is false about java coding? (a) variable names should be short (b) variable ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the following is true about servlets? (a) Servlets execute within the address space of web server ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the following is not true about session? (a) All users connect to the same session (b) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which option is true about session scope? (a) Objects are accessible only from the page in which they ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is true about time slicing? (a) Time slicing is OS service that allocates CPU time to available ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is true about threading? (a) run() method calls start() method and runs the code (b) run() ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the below statement about JUnit is false? (a) It is an open source framework (b) It ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these class is used to read characters and strings in Java from console? (a) BufferedReader (b ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the following is not a class of java.util.regex? (a) Pattern class (b) matcher class (c ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
    What data structure should be used when number of elements is fixed? (a) Array (b) Array list (c ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the following is an incorrect statement about packages? (a) Package defines a namespace in which ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...