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!
int a = 9, i = -1;
while (i <3) {
try {
System.out.print (36 / a);
}
catch (ArithmeticException e) {
System.out.print (36/2);
}
a - = 3;
i ++;
}
1 int i = 5;
2 while (i> 2) {
3 System.out.print (i);
4 if (i <4)
5 try throw new ArithmeticException ( "ex");
6 catch (ArithmeticException e) {
7 System.out.print (i);
8 break;
9}
10 finally {System.out.print (i); }
11 i--;
12}
(Java)
ABCPoint з пакета test.demo , причому клас активно використовує клас ua.additional.abc.Point
і кілька класів з пакета java.net ?
(Java)
1 class A {
2 int x = 0;
3 int y = 0;
4 A () {x = 1; }
5}
6 ...
7 System.out.print (xx + "" + xy);
8 ...
class Square {
void s (int a, int b) {
System.out.print (a * b);
return a * b;
}
void s (int r) {
System.out.print (3.14 * r * r);
}
}
public class MyClass {
public static void main (String args []) {
Square x = new Square ();
xs (3, 12);
xs (1);
}
}
Яким може бути заголовок методу method(), що містить нижченаведений програмний код, щоб викликає його програма могла коректно обробляти породжені їм виняткові ситуації?
int i = 0;
while (i <5) {
if (i == 0)
throw new ArithmeticException ( "first");
if (i == 2)
throw new IllegalArgumentException ( "second");
if (i == 4)
throw new ArithmeticException ( "third");
i ++;
}
(Java)
class Square {
int s (int a, int b) {return a * b; }
double s (double a, double b) {return a * b; }
}
public class MyClass {
public static void main (String args []) {
Square x = new Square ();
int a = 1;
double b = 2;
System.out.print (xs (a, b + a) + xs (a ++, a));
...