• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

New Mock Exam Questions

 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In preparation for the new edition of my Java 2 Exam Cram book, Marcus Green and I have been creating some new questions. We would like to get your reaction to these questions, so give it a try if you get a chance.
Starting point to new question collection.
The test headed "Experimental Test C" is the newest material. Use the "show answer" button to see the author's comments.
I am particularly interested in hearing from you if you find any errors or unfair questions. Please use the Email to Author button because it provides the most information on the question.
[ December 15, 2002: Message edited by: William Brogden ]
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the following:
boolean hashFlag = (x.hashCode() == y.hashCode());
boolean equalsFlag = x.equals( y );
boolean eqFlag = ( x == y ) ;
I would think the statement:

"If equalsFlag is false, then eqFlag must be false"
should be true. If equalsFlag is false, then the contents of x and y must be different, or they are of different types. Either way, they can't occupy the same memory location.
The exam was helpful, it pointed out my weak spots. You have a passing grade of 61.5% - isn't the real exams passing grade lower, something like 51%?
Thanks,
Greg
[ December 15, 2002: Message edited by: Greg Windwall ]
[ December 15, 2002: Message edited by: Greg Windwall ]
[ December 15, 2002: Message edited by: Greg Windwall ]
 
Greg Windwall
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For this question I got radio buttons, allowing
only one selection. I believe more than one
is correct.
public class SomeTest {
static int[] x ;
static int[] y = new int[20] ;
static String[] s1 ;
static String[] s2 = new String[20] ;
The following options make statements about the results of various operations executed before any change has affected these variables. Which of these statements is true?
a The logical test x == null will return true.
b The value retrieved by addressing y[ 0 ] is 0.
c Addressing the element s1[ 1 ] produces a null value.
d Addressing the element s2[ 1 ] produces an empty String.
 
Greg Windwall
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For the code:
public class TestQ24 {

public static final StringBuffer style =
new StringBuffer("original");
public static void main (String[] args){
TestQ24 tq = new TestQ24();
tq.modify( style );
System.out.println("Now " + style );
}
public void modify( StringBuffer sb ){
sb.append(" is modified" );
}
}
the selections below should have "Now ...":
a Compiler objects to modification of a static final variable
b Output of "original"
c Output of "original is modified"
d Output of "is modified"
 
William Brogden
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to everybody who has tried the questions and spotted problems. You could mail me directly if you like at wbrogden@bga.com
I just put an arbitrary passing percent on the test since we have not gathered enough results to compare with the real test difficulty.
Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic