1.Look at the following code: Line 1 public class ClassA Line 2 { Line 3 public
ID: 3570316 • Letter: 1
Question
1.Look at the following code:
Line 1 public class ClassA
Line 2 {
Line 3 public ClassA() {}
Line 4 public void method1(int a){}
Line 5 }
Line 6 public class ClassB extends ClassA
Line 7 {
Line 8 public ClassB(){}
Line 9 public void method1(){}
Line 10 }
Line 11 public class ClassC extends ClassB
Line 12 {
Line 13 public ClassC(){}
Line 14 public void method1(){}
Line 15 }
Which method will be executed when the following statements are executed?
ClassC item1 = new ClassA();
item1.method1();
2.These components have a consistent look and predictable behavior on any operating system.
3.What will be the tokens in the following statement?
StringTokenizer strToken =
new StringTokenizer("January 1, 2008", ", ", true);
4.To convert the double variable, d = 543.98, to a string, use the following statement:
5.Look at the following code:
Integer myNumber = new Integer(5);
int var = myNumber;
Which of the following is true about the second statement?
Explanation / Answer
1. This is an error and will cause the program to crash.
2. Swing
3. The tokens will be:
January
space
1
,
space
2008
4. String str = Double.toString(d);
5. The statement performs unboxing.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.