Comprog 2 Q5andQ6
Comprog 2 Q5andQ6
Comprog 2 Q5andQ6
Select one:
a. String 25
b. None of these
c. The code is not valid.
d. int 25
e. 0
Feedback
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. false
b. None of these
c. “a”
d. true
e. The code is not valid
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
It is the method of hiding certain elements of the implementation of a certain class?
Select one:
a. Object
b. None of these
c. Object Oriented
d. Class
e. Encapsulation
Question 4
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of these
b. Method
c. Class
d. Object
e. Constructor
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Class Method
b. None of these
c. Static Variable
d. Class Variable
e. Object Variable
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Object obj = new Object();
b. short x=1; int y = x;
c. String x = “0”; int y = x;
d. All of these
Feedback
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. String str = new String();
b. String str = new String();
c. Test t = new Test();
d. Object obj = new Object();
e. All of the choices
Feedback
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
It is a template for creating an object?
Select one:
a. Encapsulation
b. None of these
c. Method
d. Object Oriented
e. Class
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. (className) object;
b. Employee emp = new Employee(); VicePresident veep = new VicePresident(); veep =
(VicePresident)emp;
c. SuperClass sc = new SuperClass(); SubClass sbc = new SubClass(); sbc = (SubClass) sc;
Which of the following is true about Interface?
Select one:
a. It is a special kind of block containing method signatures only
b. All of these
c. It defines the signatures of a set of methods without the body
d. It is use to model multiple inheritance which allows a class to have more than one
superclass.
e. It defines a standard and public way of specifying the behavior of classes
Question 2
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public class Person {}
b. public abstract class Person {}
c. public final class Person {}
d. None of these
e. class Person{}
Feedback
Question 3
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public class interface [InterfaceName] {}
b. public [InterfaceName] {}
c. interface: [InterfaceName]
d. public interface [InterfaceName] {}
Feedback
Flag question
Question text
Select one:
a. derives
b. extends
c. implements
d. None of these
e. inherits
Question 5
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. None of these
b. Parent class
c. Subclass
d. Superclass
e. Class
Question 6
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public static void setName(){}
b. public void setName(){}
c. public final void setName(){}
d. public no_override void setName(){}
e. None of these
Feedback
Question 7
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Which of the following is the correct way to call the constructor of the parent class?
Select one:
a. super.call()
b. super()
c. this.call()
d. this()
Question 8
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public class Person extends [InterfaceName] {}
b. public class Person use [InterfaceName] {}
c. public class Person apply [InterfaceName] {}
d. public class Person implements [InterfaceName] {}
e. None of these
Feedback
Question 9
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. public final class Person {}
b. None of these
c. class Person{}
d. public class Person {}
e. public abstract class Person {}
Feedback
Your answer is correct.
Question 10
Correct
Mark 1.00 out of 1.00
Flag question
Question text
Select one:
a. Polymorphism
b. Abstraction
c. None of these
d. Inheritance
e. Interface