GMU CS 211 Questions And Answers With Verified Study Solutions
Which of the following is not a primitive data type in Java? A. int B. double D. Character C. String E. C and D - Answer-E. C and D Which of the following type casting is done implicitly in Java? A. int to float B. double to float C. byte to short D. A and B E. A and C - Answer-E. A and C Which of the following is false about constructors in java? A. All classes in java have at least one constructor B. Constructors cannot be private C. Constructors' tasks include initialization of instance variables D. Constructors cannot be inherited E. All of the above - Answer-B. Constructors cannot be private Which of the following annotation is used in JUnit framework if we want a block of code to be executed only once at the beginning of the entire test?A. @Test B. @Before C. @After D. @BeforeClass E. @AfterClass - Answer-D. @BeforeClass Which of the following assignment statement is an error(syntax) without explicit type casting? A. Super class reference = sub class object B. Sub class reference = sub class object C. Super class reference = super class object D. Sub class reference = super class object E. None of the above - Answer-D. Sub class reference = super class object
Written for
- Institution
- GMU CS 211
- Course
- GMU CS 211
Document information
- Uploaded on
- May 29, 2024
- Number of pages
- 5
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal