public class Foo { private int val; public foo(int v) (val = v;) } public static void main (String [] args) { Foo a = new Foo (10); Foo b = new Foo (10); Foo c = a; int d = 10; double e = 10.0; } Which three logical expression evaluate to true?()
A(a ==c)
B(d ==e)
C(b ==d)
D(a ==b)
E(b ==c)
F(d ==10.0)
相关问题推荐
-
Which interface does java.util.Hashable implement?()
A、 Java.util.Map.
B、 Java.util.List.
C、 Java.util.Hashable.
D、 Java.util.Collection.
-
public class test { public static void add3 (Integer i) int val = i.intValue ( ); val += 3; i = new Integer (val); } public static void main (String args [ ] ) { Integer i = new Integer (0); add3 (i); system.out.printIn (i.intValue ( ) ); } What is the result?()
A、 Compilation will fail.
B、 The program prints “0”.
C、 The program prints “3”.
D、 Compilation will succeed but an exception will be thrown at line 3.
-
Which two demonstrate an “is a” relationship? ()
Apublic interface Person{} public class Employee extends Person{}
Bpublic interface Shape{} public class Employee extends Shape{}
Cpublic interface Color{} public class Employee extends Color{}
Dpublic class Species{} public class Animal (private Species species;)
Einterface Component{} Class Container implements Component ( Private Component[ ] children; )
-
Which two construct an OutputSream that appends to the file “file.txt”? ()
AOutputStream out=new FileOutputStream(“file.txt”);
BOutputStream out=new FileOutputStream(“file.txt”, “append”);
CFileOutputStream out=new FileOutputStream(“file.txt”, true);
DFileOutputStream out=new FileOutputStream(new file(“file.txt”));
EOutputStream out=new FileOutputStream(new File(“file.txt”)true);
-
class ClassA {} class ClassB extends ClassA {} class ClassC extends ClassA {} and: ClassA p0 = new ClassA(); ClassB p1 = new ClassB(); ClassC p2 = new ClassC(); ClassA p3 = new ClassB(); ClassA p4 = new ClassC(); Which three are valid?()
Ap0 = p1;
Bp1 =p2;
Cp2 = p4;
Dp2 = (ClassC)p1;
Ep1 = (ClassB)p3;
Fp2 = (ClassC)p4;