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)
1 package newpack;
2 public class A {
3 public int a;
4 protected double c;
5 private protected int q;
6 private int j;
7 }
8 class B extends A {
9 int c;
10 B (int b1, int b2) {
11 super ();
12 c = b1;
13 d = b2;
14 }
(Java)
public class SomeClass {
public void perform () {
this.perform (1);
System.out.print ( "1");
}
public void perform (int val) {
System.out.print (val);
}
public static void main (String [] args) {
SomeClass c = new SomeClass2 ();
c.perform (4);
}
}
class SomeClass2 extends SomeClass {
public void perform () {
super.perform ();
System.out.print ( "3");
}
public void perform (int val) {
super.perform ();
System.out.print (val);
}
}
(Java)
int b [] = new int [5];
for (int i = 0; i < = b.length (); i ++) {
b [i] = Math.sqrt (i);
}
(Java)
public abstract class SomeClass implements Runnable {
public final static Object one = new Object (), two = new Object ();
public static void main (String s []) {
Thread t1 = new Thread () {
public void run () {
synchronized (one) {
synchronized (two) {
System.out.print ( "1");
}
}
}
};
Thread t2 = new Thread () {
public void run () {
synchronized (two) {
try {
Thread.sleep (1000);
} Catch (InterruptedException e) {
e.printStackTrace ();
}
synchronized (one) {
System.out.print ( "2");
}
}
}
};
t1.start ();
t2.start ();
}
}
(Java)
(Java)
(Java)