Looking for CS 1102-01 Programming 1 - AY2025-T3 test answers and solutions? Browse our comprehensive collection of verified answers for CS 1102-01 Programming 1 - AY2025-T3 at my.uopeople.edu.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
What is the output of the following code?
interface MyInterface {
default void display() {
System.out.println("MyInterface");
}
}
class MyClass implements MyInterface {
public void display() {
System.out.println("MyClass");
}
}
public class Main {
public static void main(String[] args) {
MyInterface obj = new MyClass();
obj.display();
}
}
What is the result of the following expression?
int result = 10 / 3;
What is the output of the following code snippet?
int i = 0;
while (i < 5) {
System.out.print(i + " ");
i++;
}
Which of the following is the correct way to declare a constant variable in Java?