📄 mockcert03.txt
字号:
public class StrEq{
public static void main(String argv[]){
StrEq s = new StrEq();
}
private StrEq(){
String s = "Marcus";
String s2 = new String("Marcus");
if(s == s2){
System.out.println("we have a match");
}else{
System.out.println("Not equal");
}
}
}
Mutiple:
1) Compile time error caused by private constructor
2) Output of "we have a match"
3) Output of "Not equal"
4) Compile time error by attempting to compare strings using ==
Question 91
===========================================================
1) What will happen when you attempt to compile and run the following code
import java.io.*;
class Base{
public static void amethod()throws FileNotFoundException{}
}
public class ExcepDemo extends Base{
public static void main(String argv[]){
ExcepDemo e = new ExcepDemo();
}
public static void amethod(){}
protected ExcepDemo(){
try{
DataInputStream din = new DataInputStream(System.in);
System.out.println("Pausing");
din.readChar();
System.out.println("Continuing");
this.amethod();
}catch(IOException ioe) {}
}
}
Mutiple:
1) Compile time error caused by protected constructor
2) Compile time error caused by amethod not declaring Exception
3) Runtime error caused by amethod not declaring Exception
4) Compile and run with output of "Pausing" and "Continuing" after a key is hit
Question 92
===========================================================
What will happen when you attempt to compile and run this program
public class Outer{
public String name = "Outer";
public static void main(String argv[]){
Inner i = new Inner();
i.showName();
}//End of main
private class Inner{
String name =new String("Inner");
void showName(){
System.out.println(name);
}
}//End of Inner class
}
Mutiple:
1) Compile and run with output of "Outer"
2) Compile and run with output of "Inner"
3) Compile time error because Inner is declared as private
4) Compile time error because of the line creating the instance of Inner
Question 93
===========================================================
What will happen when you attempt to compile and run this code
//Demonstration of event handling
import java.awt.event.*;
import java.awt.*;
public class MyWc extends Frame implements WindowListener{
public static void main(String argv[]){
MyWc mwc = new MyWc();
}
public void windowClosing(WindowEvent we){
System.exit(0);
}//End of windowClosing
public void MyWc(){
setSize(300,300);
setVisible(true);
}
}//End of class
Mutiple:
1) Error at compile time
2) Visible Frame created that that can be closed
3) Compilation but no output at run time
4) Error at compile time because of comment before import statements
Question 94
===========================================================
Which option most fully describes will happen when you attempt to compile and run the following code
public class MyAr{
public static void main(String argv[]) {
MyAr m = new MyAr();
m.amethod();
}
public void amethod(){
static int i;
System.out.println(i);
}
}
Only One:
1) Compilation and output of the value 0
2) Compile time error because i has not been initialized
3) Compilation and output of null
4) Compile time error
Question 95
===========================================================
Which of the following will compile correctly
Mutiple:
1) short myshort = 99S;
2) String name = 'Excellent tutorial Mr Green';
3) char c = 17c;
4) int z = 015;
Question 96
===========================================================
Which of the following are Java key words
Mutiple:
1) double
2) Switch
3) then
4) instanceof
Question 97
===========================================================
What will be output by the following line?
Mutiple:
1) -2
2) 2.0
3) -3
4) -3.0
Question 98
===========================================================
Given the following main method in a class called Cycle and a command line of
java Cycle one two
what will be output?
public static void main(String bicycle[]){
System.out.println(bicycle[0]);
}
Mutiple:
1) None of these options
2) cycle
3) one
4) two
Question 99
===========================================================
Which of the following statements are true?
Mutiple:
1) At the root of the collection hierarchy is a class called Collection
2) The collection interface contains a method called enumerator
3) The interator method returns an instance of the Vector class
4) The set interface is designed for unique elements
Question 100
===========================================================
Which of the following statements are correct?
Mutiple:
1) If multiple listeners are added to a component only events for the last listener added will be processed
2) If multiple listeners are added to a component the events will be processed for all but with no guarantee in the order
3) Adding multiple listeners to a comnponent will cause a compile time error
4) You may remove as well add listeners to a component.
JTest
Sun Certified Programmer for Java2 Platform
Examination Score Report
CANDIDATE: JTest
CANDIDATE ID: JT12345678 DATE:2002-3-1(YYYY-MM-DD)
Exam: JTest SCJP Mock Exam
Exam Results:
Correct Answers Your Answers Result
1 2 3 4 5 1 2 3 4 5
------------------------------------------------------------------------------------
Question # 01 5 5 0
------------------------------------------------------------------------------------
Question # 02 1 1 0
------------------------------------------------------------------------------------
Question # 03 2 3 2 3 0
------------------------------------------------------------------------------------
Question # 04 1 1 0
------------------------------------------------------------------------------------
Question # 05 4 4 0
------------------------------------------------------------------------------------
Question # 06 2 3 4 5 2 3 4 5 0
------------------------------------------------------------------------------------
Question # 07 1 3 4 5 1 3 4 5 0
------------------------------------------------------------------------------------
Question # 08 4 4 0
------------------------------------------------------------------------------------
Question # 09 2 2 0
------------------------------------------------------------------------------------
Question # 10 3 3 0
------------------------------------------------------------------------------------
Question # 11 3 3 0
------------------------------------------------------------------------------------
Question # 12 3 3 0
------------------------------------------------------------------------------------
Question # 13 1 1 0
------------------------------------------------------------------------------------
Question # 14 2 3 2 3 0
------------------------------------------------------------------------------------
Question # 15 3 3 0
------------------------------------------------------------------------------------
Question # 16 4 4 0
------------------------------------------------------------------------------------
Question # 17 3 3 0
------------------------------------------------------------------------------------
Question # 18 3 3 0
------------------------------------------------------------------------------------
Question # 19 3 3 0
------------------------------------------------------------------------------------
Question # 20 3 3 0
------------------------------------------------------------------------------------
Question # 21 2 2 0
------------------------------------------------------------------------------------
Question # 22 2 2 0
------------------------------------------------------------------------------------
Question # 23 3 4 3 4 0
------------------------------------------------------------------------------------
Question # 24 1 3 1 3 0
------------------------------------------------------------------------------------
Question # 25 2 2 0
------------------------------------------------------------------------------------
Question # 26 2 5 2 5 0
------------------------------------------------------------------------------------
Question # 27 3 5 3 5 0
------------------------------------------------------------------------------------
Question # 28 2 2 0
------------------------------------------------------------------------------------
Question # 29 3 3 0
------------------------------------------------------------------------------------
Question # 30 3 3 0
------------------------------------------------------------------------------------
Question # 31 2 2 0
------------------------------------------------------------------------------------
Question # 32 3 3 0
------------------------------------------------------------------------------------
Question # 33 1 1 0
------------------------------------------------------------------------------------
Question # 34 2 2 0
------------------------------------------------------------------------------------
Question # 35 2 2 0
------------------------------------------------------------------------------------
Question # 36 1 4 1 4 0
------------------------------------------------------------------------------------
Question # 37 1 3 1 3 0
------------------------------------------------------------------------------------
Question # 38 1 1 0
------------------------------------------------------------------------------------
Question # 39 3 3 0
------------------------------------------------------------------------------------
Question # 40 2 2 0
------------------------------------------------------------------------------------
Question # 41 3 3 0
------------------------------------------------------------------------------------
Question # 42 2 2 0
------------------------------------------------------------------------------------
Question # 43 3 3 0
------------------------------------------------------------------------------------
Question # 44 1 2 1 2 0
------------------------------------------------------------------------------------
Question # 45 3 3 0
------------------------------------------------------------------------------------
Question # 46 1 1 0
------------------------------------------------------------------------------------
Question # 47 1 1 0
------------------------------------------------------------------------------------
Question # 48 1 1 0
------------------------------------------------------------------------------------
Question # 49 2 2 0
------------------------------------------------------------------------------------
Question # 50 3 3 0
------------------------------------------------------------------------------------
Question # 51 1 1 0
------------------------------------------------------------------------------------
Question # 52 5 5 0
------------------------------------------------------------------------------------
Question # 53 2 2 0
------------------------------------------------------------------------------------
Question # 54 3 3 0
------------------------------------------------------------------------------------
Question # 55 1 1 0
------------------------------------------------------------------------------------
Question # 56 1 1 0
------------------------------------------------------------------------------------
Question # 57 2 2 0
------------------------------------------------------------------------------------
Question # 58 1 1 0
------------------------------------------------------------------------------------
Question # 59 1 2 3 4 1 2 3 4 0
------------------------------------------------------------------------------------
Question # 60 3 5 3 5 0
------------------------------------------------------------------------------------
Question # 61 1 1 0
------------------------------------------------------------------------------------
Question # 62 4 4 0
------------------------------------------------------------------------------------
Question # 63 1 2 4 1 2 4 0
------------------------------------------------------------------------------------
Question # 64 2 2 0
------------------------------------------------------------------------------------
Question # 65 1 3 1 3 0
------------------------------------------------------------------------------------
Question # 66 4 4 0
------------------------------------------------------------------------------------
Question # 67 4 4 0
------------------------------------------------------------------------------------
Question # 68 1 1 0
------------------------------------------------------------------------------------
Question # 69 4 4 0
------------------------------------------------------------------------------------
Question # 70 2 2 0
------------------------------------------------------------------------------------
Question # 71 2 2 0
------------------------------------------------------------------------------------
Question # 72 3 3 0
------------------------------------------------------------------------------------
Question # 73 4 4 0
------------------------------------------------------------------------------------
Question # 74 1 1 0
------------------------------------------------------------------------------------
Question # 75 1 2 3 1 2 3 0
------------------------------------------------------------------------------------
Question # 76 2 2 0
------------------------------------------------------------------------------------
Question # 77 2 3 2 3 0
------------------------------------------------------------------------------------
Question # 78 4 4 0
------------------------------------------------------------------------------------
Question # 79 2 2 0
------------------------------------------------------------------------------------
Question # 80 4 4 0
------------------------------------------------------------------------------------
Question # 81 2 2 0
------------------------------------------------------------------------------------
Question # 82 1 2 3 1 2 3 0
------------------------------------------------------------------------------------
Question # 83 4 4 0
------------------------------------------------------------------------------------
Question # 84 1 1 0
------------------------------------------------------------------------------------
Question # 85 4 4 0
------------------------------------------------------------------------------------
Question # 86 1 1 0
------------------------------------------------------------------------------------
Question # 87 4 4 0
------------------------------------------------------------------------------------
Question # 88 1 1 0
------------------------------------------------------------------------------------
Question # 89 1 1 0
------------------------------------------------------------------------------------
Question # 90 3 3 0
------------------------------------------------------------------------------------
Question # 91 4 4 0
------------------------------------------------------------------------------------
Question # 92 4 4 0
------------------------------------------------------------------------------------
Question # 93 1 1 0
------------------------------------------------------------------------------------
Question # 94 4 4 0
------------------------------------------------------------------------------------
Question # 95 4 4 0
------------------------------------------------------------------------------------
Question # 96 1 4 1 4 0
------------------------------------------------------------------------------------
Question # 97 4 4 0
------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -