|
What is the target variable in an Event?
- the Object() where the event came from,
- the Object() where the event is destined for,
- what the Object() that generated the event was doing,
What is the statement to assign a unicode constant CODE with 0x30a0?
The following code resides in the source?
class StringTest {
public static void main( String [] agrs) { // // String comparing // String a,b; StringBuffer c,d; c = new StringBuffer("Hello"); a = new String("Hello"); b = a; d = c;
if ( <<<operator>>> ) { }
} } //class |
Which of the following statement return true for the <<>> line in StringTest.class?
- b.equals(a)
- b==a
- d==c
- d.equals(c)
Which are valid identifiers?
- %fred
- *fred
- thisfred
- 2fred
- fred
We have the following class X,
|
public class X { public void method(); } <<<STATEMENTS>>>
|
Which of the following statement return true for the <<>> line in StringTest.class?
- abstract void method();
- class Y extends X { }
- package java.util;
- abstract class Z { }
Which code fragements would correctly identify the number of arguments passed via command line to a Java Application?
- int count = args.length;
- int count = 0; while args[count] !=null) count++;
- int count = 0;while (!(args[count].equals(""))) count++;
- int count = args.length - 1;
FilterOutputStream is the parent class for BufferedOutputStream, DataOutputStream and PrintStream.
Which classes are valid argument for the constructor of a FilterOutputStream?
- InputStream
- OutputStream
- File
- RandomAccessFile
- StreamTokenizer
Given the following method body:
1: 2:{ 3: if (unsafe()) { 4: unsafe(); 5: } 6: else { 7: safe(); 7: } 8:}
|
The method “unsafe” might throw an AWTException (which is not a subclass of RunTimeException).
Which correctly completes the method of declaration when added at line one(1:)?
- public AWTException methodName()
- public void methodName()
- public void methodName() throws AWTException
- public void methodName() throw AWTException
- public void methodName() throws Exception
Given a TextField and is constructed like this:
|
TextField = new TextField(30);
|
- The displayed width is 30 columns.
- The displayed string can use multiple fonts.
- The user will be able to edit the character string.
- The displayed line will show exactly thirthy characters.
- The maximum of characters in a line will be thirthy.
Given this skeleton of a class currently under construction:
public class Example { int x, y;
public Example( int a) { //lots of complex computation x=a; }
public Example( int a, int b) { //do everythinf the same as single argument // including assignment x=a y=b; } }
|
What is the most concise way to code the “do everything the same as single argument?
|