class B { private String name; public B(String name) {this.name = name;} public String toString() {return name;} protected void finalize() {System.out.print(name);} } class J { static B bc; static int i = 1; static B m1(B b) {bc = b; return new B("B" + i++);} public static void main (String[] args) { B x = m1(new B("Ba")), y = m1(new B("Bb")); System.out.println(", " + x + ", " + y + ", " + bc); }}
class A { private static int counter; public static int getCounter(){return counter++;} private static int innerCounter; public static int getInnerCounter(){return innerCounter++;} private String name; A() {name = "A" + getCounter();} class B { private String name; B() { name = "B" + getInnerCounter(); System.out.print(A.this.name + name); // 1 }} public static void main(String[] args) { new A().new B(); // 2 A a1 = new A(); a1.new B(); // 3 a1.new B(); // 4 }}
public class Test { public static void main(String [] args) { byte [][] big = new byte [7][7]; byte [][] b = new byte [2][1]; byte b3 = 5; byte b2 [][][][] = new byte [2][3][1][2]; //line to be inserted here } } which of the following lines of code could be inserted at line 7, and still allow the code to compile? (Choose four that would work.) A. b2[0][1] = b; B. b[0][0] = b3; C. b2[1][1][0] = b[0][0]; D. b2[1][2][0] = b; E. b2[0][1][0][0] = b[0][0]; F. b2[0][1] = big;