Septimiu Pelau

Greenhorn
+ Follow
since Feb 16, 2007
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Septimiu Pelau

My story:

A while ago I bought the Sierra & Bates SCJP5 study guide. I started preparing myself, but... there is always a BUT, isn't it!
The busy schedule at work (not to mention the busy schedule at home - two little kids) did interrupt my study. I resumed it just to pause again, re-start it after a couple of months, finally I read once the guide from beginning to end. I wanted to have a second read as by the time I finished the book I hardly remembered the beginning
So the second go-through happened more or less the same way until I wrapped it up this summer. For those who think studying 15 minutes per day is okay, sorry to disappoint you, it's not: running in this slow gear you forget faster than you learn. So I took advantage of the summer month of August where work is less busy (my kids also grew up meanwhile, ha-ha) and re-read it again, doing mock-up tests and writing down all tricks I bumped into (four or five pages). The exam questions were somehow easier than the tests but concentration is not that good as it at home. So it compensates. Overall I scored higher in the areas I thought I'm not that good and lower in the areas where I thought I'm expert. I am nevertheless very happy with the result. After so much time I can jot it down from my TODO's list
What can I advise from my experience: do a couple of tests in a timely manner. That makes you be able to concentrate successfully for three hours. I found Whizlabs tests good but not fantastic as they still have questions about division by zero, float NaN or DataInputStream even though they are not on the exam objectives. Probably the SUN tests are the best. Good luck to you all

Septimiu Pelau

14 years ago

Originally posted by Ade Barkah:
In 3rd para: "...constructing a Reader or Writer will automatically create a file for you..."

Should perhaps read: "...constructing a FileWriter or PrintWriter will automatically create a file for you..."

(Readers don't create files, nor do most Writers.)



...or a FileOutputStream
some more clarifications.

class cardBoard {
Short story = 5; //Short wrapper object in each CardBoard instance
CardBoard go(CardBoard cb) {
cb = null; //sets local "cb" reference to null. Note that cb is a copy of reference c2. Setting cb to null does not imply that c2 is also set to null. However you could modify the object 2 using cb reference as both references (cb and c2) refer the same object.
return cb; //returns null reference
}

public static void main(String[] args) {
CardBoard c1 = new CardBoard(); //object 1 referenced by c1
CardBoard c2 = new CardBoard(); //object 2 referenced by c2
CardBoard c3 = c1.go(c2); //here the argument is C2 reference but a copy of it is being passed to go() which returns null.
c1 = null; //c1 set to null, so object 1 and its Short are eligible.
// do stuff
object 2 is still being referred by c2. c3 is not an object, just an object reference therefore is not eligible.
}
}
are these statements equivalent:

Class A implements B,C,D

and

Interface B extends C,D
Class A implements B
You are confusing the access modifiers of interface methods with interfaces. While interface methods are indeed public and abstract implicitly the interfaces are only abstract. Therefore an interface can have the default access modifier (for this reason it must be declared within the same file with a public class or interface)
Then it's a good candidate for the errata, but that post was locked one year ago.
Hi there

the first chapter's two-minute drill (SCJP5, page 69) states at Interface Implementation, bullet #2:

"Interfaces can be implemented by any class, from any inheritance tree."

I think this is correct only if interfaces are declared as public. You can have a default interface as well, which is not visible by a class from a different package.

Am I right?

thanks,
Septimiu