Java Conditional, Loops, Inheritence Quiz Questions
Java Conditional, Loops, Inheritence Quiz Questions
CLASS :
Java conditional,loops,inheritence
DATE :
25 Questions
2.
a) 2 2 b) 2 3
c) 3 2 d) 3 3
3.
4.
c) extends d) extent
6.
a) 0 b) 1
c) 2 d) compilation error
7.
a) 1 2 b) 2 2
c) 3 1 d) 2 1
e) 1 3
8.
a) 10 10 b) 10 20
c) 20 10 d) compilation error
The class that inherits an already
9.
defined class is called ___.
a) Subclass b) Superclass
a) TRUE b) FALSE
11.
a) YES b) NO
15. What will be the output of the program?
a) i = 1, j = 0 b) i = 1, j = 4
c) i = 3, j = 4 d) compilation error
17.
a) a b c b) b c
c) a b d) Compilation fails.
18. In object oriented programming new
a) Encapsulation b) Interface
c) Inheritance d) Aggregation
e) constructor
19.
a) 2 3 b) 2 2
e) Compilation Error
20.
a) 10 b) 11
c) 12 d) 13
21. Hiding internal data from outside world
a) Inheritance. b) Duplication.
c) Polymorphism d) Encapsulation.
22.
a) 30 b) 20
programming is/are
c) Program will compile successfully. d) The program will give a runtime error.
Answer Key
1. c 8. d 15. d 22. d
2. a 9. a 16. a,d 23. c
3. a 10. a 17. b 24. a,c,d
4. a 11. b 18. c 25. c,d
5. a 12. b 19. a
6. c 13. b 20. d
7. a 14. a 21. d