Looking for Програмування мовою Java test answers and solutions? Browse our comprehensive collection of verified answers for Програмування мовою Java at moodle.chnu.edu.ua.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
(Java)
int i = 0;
while (i <5)
{
System.out.print (i);
if (i> 2)
try {
throw new ArithmeticException ( "ex");
}
catch (ArithmeticException e) {
System.out.print (i);
break;
}
i ++;
}
(Java)
public class SomeClass {
public static void main (String [] args) {
SomeClass s = new SomeClass ( "5", "6");
SomeClass s1 = new SomeClass ( "10", "12");
s1.doSomething (s);
System.out.print (s1.x + s1.y + sx + sy);
}
private void doSomething (SomeClass s) {
sx = "5";
this.y = "6";
}
public SomeClass (String x, String y) {
this.x = x;
this.y = y;
}
String x, y;
}
(Java)
(Java)
(Java)
int b [] = new int [5];
for (int i = 0; i <b.length (); i ++) {
b [i] = Math.sqrt (i);
}
(Java)
1 class A {
2 int a;
3 int b;
4 }
5 class B extends A {
6 int b;
7 ...
8 }
Яким кодом необхідно доповнити рядок 7, щоб в класі Bзмінна b класу А встановлювалася рівною 1?
int a = 8, i = -1;
while (i <2) {
try {
System.out.print (36 / a);
}
catch (ArithmeticException e) {
System.out.print (36/2);
}
a - = 2;
i ++;
}