Question 11
Given: What is the result?
- [null:-]
- [ : ]
- [null:null]
- [:null]
Question 12
Which two Java reserved words are used to implement encapsulation?
- final
- static
- public
- extends
- private
Question 13
Given the code fragment: Which code fragment can be inserted at line n1 to enable the code to print 0.0?
- Ball b = null; b.weight = 0.0;
- Ball.weight = 0.0;
- Ball b = new Ball(0.0);
- Ball b = new Ball();
Question 14
Which two statements are true about the Java Runtime Environment (JRE)?
- It is responsible for garbage collection.
- It interprets bytecode stored in a .class file.
- It contains the JDK and Java APIs.
- It is platform independent.
- You must install the JRE to compile a .java file.
Question 15
Identify two features of Java.
- architecture dependent
- platform independent
- single threaded
- robust