Looking for Об’єктно-орієнтоване програмування test answers and solutions? Browse our comprehensive collection of verified answers for Об’єктно-орієнтоване програмування at vns.lpnu.ua.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
class Toy {
public void printName() {
System.out.println("Toy");
}
}
class Doll extends Toy {
public String printName() {
System.out.println("Doll");
return "Doll";
}
}
public class TestToys {
public static void main(String[] args) {
Toy doll = new Doll();
doll.printName();
}
}
Який результат?
Зіставте наступні типи з їх значеннями по замовчуванню
int[] myArray = _____ int[3];
Яким буде результат виконання коду?
public class Test{
public static void main(String[] args){
for(int i = 0; i < 10; i++){
if(i % 2 == 0)
continue;
System.out.println(i);
}
}
}
Що буде результатом виконання коду?
public class Test{
public static void main(String[] args){
int i = 0;
for(; i < 10; i++){
break;
}
System.out.println(i);
}
}
Яким буде результат виконання коду?
public class Test{
public static void main(String[] args){
int i = 1;
for(i = 0 ; i < 10; i++){
}
System.out.println(i);
}
}
Що буде результатом виконання коду?public class Test{
public static void main(String[] args){
int a = 0, b = 5;
while(b--){
System.out.println(a++);
}
}
}