Thomas Misik

Greenhorn
+ Follow
since Sep 30, 2000
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Thomas Misik

Can anyone suggest a final mock exam to take before writing the SCJP? At this point in the game I have written many, but if anyone out there could suggest one that resembles the actual exam (toughness of questions, etc.) most closely, it would be a great help. The reason I ask is because it will hopefully be the last one I take before writing the exam.
Thanks in advance,
Thomas
I thought I was confident in figuring out loops, however, if anyone could give me some clarification as to their pattern, it would be greatly appreciated. Take this sample (MindQ):
30. Consider the code fragment below:

outer: for( int i = 1; i <3; i++ )
{ inner: for( j = 1; j < 3; j++ )
{ if( j==2 )
continue outer;
System.out.println( "i = " +i ", j = " + j );
}
}

Which of the following would be printed to standard output?
a) i = 1, j = 1
b) i = 1, j = 2
c) i = 1, j = 3
d) i = 2, j = 1
e) i = 2, j = 2
f) i = 2, j = 3
g) i = 3, j = 1
h) i = 3, j = 2

I think the answer is a, b,..but I always get confused at this point - does i (after continue outer) start back at 1, or does it carry on from where it left off, being 2?
Matt,
The first two Marcus Green exams are considerably easier than his third. The third exam asks a lot more obscure questions, but it is a good way to hammer out any questions you may have. I think they are a good indication as to how your preparation is going; the people I know who have passed the SCJP all took Marcus Green's exams + the MindQ exam and said they were pretty comparable. You should also check out an exam applet called Jxam (I think you can find it under "Gramps" at this site....it's a good simulator for sure). Take it easy, and good luck on the exam.
Thomas
Sayli C,
I am writing the certification in a few days, and yes I am a little nervous. However, I have spent considerable time preparing for it. I would say that you have already started at a great place Javaranch, because everyone here is in the same boat (or barnyard, whatever the case may be). In this forum you will find tons of questions ranging from the obvious to the obscure - all of which come as a great help. I would advise doing as many mock exams as possible; they not only prepare you to see how the same question can be asked several different ways, but they will help nail down any confusion you may have with just about anything http://www.javaranch.com/maha/_Mock_Exams/_mock_exams.html. Marcus Green's website is also a great place to find enormous amounts of information (do the mock exams and read the tutorials) http://www.jchq.net/. Like I said before, if you browse through this website, you will learn many things you need to know to be able to pass the SCJP. Finally, practicing code, learning from the compile errors gererated is a way to get knowledge from the source, and go through the API a lot. Good luck studying,
Thomas
NOTE: abstract methods CAN have regular methods, please disregard the comments on the interface method having to be empty.
Thomas
Shilpa Jain,
I think the answer to that is yes because interfaces are abstract by default. Abstract classes are just templates you design yourself, so I don't see why you couldn't implement an interface (as long as the methods were left unwritten....public void actionPerformed(ActionEvent e){empty}). Since you are allowed to have non-abstract methods in an abstract class, and interfaces & their methods are assumed to be abstract, I can't see why you couldn't implement them. I could be wrong here, so maybe one of the Java gurus could post a definitive answer.
Regards,
Thomas
Java Keywords:

abstract; boolean; break; byte; case; catch; char; class; const*; continue; default; do; double; else; extends; final; finally; float; for; goto*; if; implements; import; instanceof; int; interface; long; native; new; null; package; private; protected; public; return; short; static; super; switch; synchronized; this; throw; throws; transient; try; void; volatile; while;
The words with asterisks are reserved and not currently used. Note that all of the keywords
are in lowercase, thus for is a keyword but FOR
is not. There is some debate as to if null is a keyword but I suggest that for the purposes of the exam you assume it is.



These have been taken directly from Marcus Green's tutorials, whick I have found to be a great help; it's compact, consice and informative. However, I have not heard of any new keywords (I'm pretty sure there aren't any).
Hope this helps,
Thomas






















Stephanie & Jane,
Thanks a lot guys, it was much appreciated. All of the Java I have written has been using Ultraedit; I've written many if statements, but have not really had to worry about ?: . It seems a rather silly question now, but I definitely needed some clarification on it. Thanks again, and since I'm writing the exam at the end of this month, I'm sure I'll be asking some more questions soon
Thomas
I am fairly confident in most uses of all operators used in Java, but there are some that still cause a bit of confusion. They would be:
^ (XOR) on Binary or boolean;
? - for instance: (as seen in MindQ)
Q).If arr[] contains only positive integer values, what does this function do?
public int guessWhat( int arr[] )
{ int x= 0;
for( int i = 0; i < arr.length; i++ )
x = x < arr[i] ? arr[i] : x;
return x;
}
/* Will this return the highest positive integer value in this array? */
If anyone knows a good (and concise) source on these operators and there functions, could they please post a link up? It would be greatly appreciated.
Thanks,
Thomas
Matt DeLacey,

32.If a base class has a method defined as
void method() { }
Which of the following are legal prototypes in a derived class of this class.
Select all correct answers.
A.void method() { }
B.int method() { return 0;}
C.void method(int i) { }
D.private void method() { }
Answers are: A + C
(I don't understand why C is correct)

/* C is correct (I believe) because it is just overloading the constructor in the base class.*/
23.Which of the following are legal array declarations. Select all correct answers.
A.int i[5][];
B.int i[][];
C.int []i[];
D.int i[5][5];
E.int[][] a;
Answers are: B,C,E
(I don't understand why D is not correct)
/* D is not correct because you cannot declare the size of the array in this way. The proper way to declare it would be:
int []i[] = new int[5][5]
or...
int [][]i = new ...
or
int i[][] = new ...
You are not allowed to have anything within the hard braces on the left-hand side of the declaration; will produce a compile error. */
Regards,
Thomas
Debabrata Deb,
You're welcome. I have found this forum very useful in narrowing down what I do/don't need to know for the certification. I'm taking the exam next week myself, so any helpful hints come in handy at this point. Good luck!
Regards,
Thomas
Debabrata Deb,

GridBagLayout is covered on the exam. Everyone that I know who has taken it were given at least one question; usually pertaining to GridBagConstraints. Apparently, the important classes to consider (when using GridBagConstraints) are:
gridwidth and gridheight - determines how many columns and rows a component can occupy.
fill - controls how a component stretches to fill the area (e.g., GridBagConstraints.NONE, GridBagConstraints.HORIZONTAL, etc.)
insets - indicates the external padding along the cell boundaries
weightx and weighty - control how an area grows or shrinks beyond its initial size.
Also, I've been told to know what the ANCHOR field does. If the component you're adding does not fill the entire area, you can use the anchor field to specify where, in the area, you want it(GridBagconstraints.CENTER)
Good luck on the exam...
Thomas
Thanks for the suggestions, and true enough, the objectives are the same, so I guess I'm just a little anxious. Subsequently, Javaranch and Marcus Green's sites are the two best that I have come across (M.Green's tutorials and mocks have been a great help + great resources at Javaranch). I guess I've become a little caught-up in the new exam hysteria that has been going around lately.
Cheers,
Thomas
I have written innumerable mock exams, but for some strange reason, I care to find more of them. Does anyone know if there are any new Mock Exams(applets or otherwise) since October 4th? If so, any information would be greatly appreciated.
Thanks in advance,
Thomas
Dear Anil Kuchana,
Could you please email the tutorial to me as well? My email is: [email protected]
Thanks