MIDTERM-EXAM-Object-Oriented-Programming.pdf - 3/17/23 ...

Doc Preview
Pages 18
Identified Q&As 49
Total views 32
3/17/23, 2:27 PMMIDTERM EXAM: Attempt review trimestralexam.amaesonline.com/2223/mod/quiz/review.php?attempt=116467&cmid=2316&showall=1#question-116748-71/18Home/My courses/UGRD-CS6203C-2223T/MIDTERM EXAM/MIDTERM EXAM Started onFriday, 17 March 2023, 1:10 PM StateFinished Completed onFriday, 17 March 2023, 2:30 PM Time taken1 hour 20 mins Marks40.00/50.00 Grade80.00out of 100.00 Question 1 Correct Mark 1.00 out of 1.00 Question 2 Correct Mark 1.00 out of 1.00 In which access should a constructor be defined, so that object of the class can be created in any function? a.Any access specifier will work b.Private c.Public d.Protected Your answer is correct. What is the output of the below Java code with an abstract class and inner class? public abstract class AbstractClassTest6 { class Anonymous { int a=5; } public static void main(String args[]) { System.out.print("Inner class is present.."); } } a.No output b.Compiler error c.None of the above d.Inner class is present.. Your answer is correct.
3/17/23, 2:27 PMMIDTERM EXAM: Attempt review trimestralexam.amaesonline.com/2223/mod/quiz/review.php?attempt=116467&cmid=2316&showall=1#question-116748-72/18Question 3 Correct Mark 1.00 out of 1.00 Question 4 Correct Mark 1.00 out of 1.00 Question 5 Correct Mark 1.00 out of 1.00 Which among the following is wrong syntax related to static data members? a.dataType className :: memberName =value; b.static dataType memberName; c.className :: staticDataMember; d.className : dataType -> memberName; Your answer is correct. Can we declare an interface as final? a.Yes b.No Your answer is correct. Which among the following is the correct syntax to access static data member without using member function? a.className . staticDataMember; b.className : staticDataMember; c.className -> staticDataMember; d.className :: staticDataMember; Your answer is correct.
Course Hero Badge

Want to read all 18 pages?

Previewing 3 of 18 pages Upload your study docs or become a member.
3/17/23, 2:27 PMMIDTERM EXAM: Attempt review trimestralexam.amaesonline.com/2223/mod/quiz/review.php?attempt=116467&cmid=2316&showall=1#question-116748-74/18Question 9 Incorrect Mark 0.00 out of 1.00 Question 10 Correct Mark 1.00 out of 1.00 Question 11 Correct Mark 1.00 out of 1.00 A protected member can be accessed in, a.a non-subclass of different package b.a subclass of the same package c.a non-subclass of the same package d.a subclass of different package Your answer is incorrect. What is the output of the following code: class eq { public static void main(String args[]) { String s1 = “Hello”; String s2 = new String(s1); System.out.println(s1==s2); } } a.0 b.1 c.false d.true Your answer is correct. The copy constructors can be used to ________ a.Copy an object for type casting b.Copy an object so that it can be passed to another primitive type variable c.Copy an object so that it can be passed to a class d.Copy an object so that it can be passed to a function Your answer is correct.
Course Hero Badge

End of preview

Want to read all 18 pages? Upload your study docs or become a member.