Documente Academic
Documente Profesional
Documente Cultură
Grade:___________
int [] a = {1,2,3,4,5,6};
int i = a.length - 1;
while(i>=0){
System.out.print(a[i]);
i--;
}
int i = 10;
while (i++ <= 10) {
i++;
}
System.out.print(i);
Yourname:__________________________
int i = 10;
while (++i <= 10) {
i++;
}
System.out.print(i);
Grade:___________
18.
Given the code:
1
2
3
4
5
package com.mycompany;
public class Hotel {
public int roomNr = 100;
}
package com.mycompany;
public class Hotel {
private int roomNr = 100;
}
What is true?
A. The code demonstrates polymorphism.
B. The class is fully encapsulated.
C. The variable roomNr breaks
encapsulation.
D. Variables beginDttm and endDttm break
polymorphism.
E. The method book breaks encapsulation.