Looking for Object Oriented Development (MESIIN472925) test answers and solutions? Browse our comprehensive collection of verified answers for Object Oriented Development (MESIIN472925) at learning.devinci.fr.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Which of the following is the correct way to declare a constant in Java?
Consider the code :
public class Test {
public static void main(String[] args) {
int[] a = {1, 2, 3};
int[] b = a;
b[0] = 99;
System.out.println(a[0]);
}
}
what will be printed?Given the following code :
class PolymorphismExample {
void display(int a) {
System.out.println("Method with int parameter: " + a);
}
void display(String a) {
System.out.println("Method with String parameter: " + a);
}
public static void main(String[] args) {
PolymorphismExample obj = new PolymorphismExample();
obj.display("10 is an integer");
}
}
What is the output of the following code?
To call the constructor Person( String firstName, String lastName) of a class "Person" from another constructor Person(String firstName) of the same class, we use the instruction this.Person(firstName, "Not defined")
The Open/Closed Principle states that a class should be:
The Dependency Inversion Principle recommends that:
Which example follows the Interface Segregation Principle?
What does the “S” in SOLID stand for?
What will be printed?
public class Test {
public static void main(String[] args) {
String s1 = "Java";
String s2 = new String("Java");
System.out.println(s1 == s2);
System.out.println(s1.equals(s2));
}
}