Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!

Ian Edwards

Ranch Hand
+ Follow
since Aug 14, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Ian Edwards

Its been nearly a year since I did mine but I think it was 'all that apply'.
I would suggest that you do practice with the mock exams. They will help to understand the various elements of the language and get you 'match-fit' for the real thing. Also, different mock exams will have their own way of presenting things also which should provide a new perspective.
You would normally use the final modifier on a method to prevent anyone over-riding the method if they are extending your class.

Of course, a private method cannot be inherited so a final modifier is redundant in this case.
You don't necessarily have to seek out examples online. If you want to understand a topic type in an example from the book and then start changing it to see what happens in different scenarios.

Something I used to do in the past was to copy and paste a program that someone had posted in this forum to see for myself what happens when the program is run. And again, start changing the program to see how different methods work, what happens if you try running the program with different data in the variables.

You could also try buying exam prep software like Whizlabs.
The K&B book has a useful analogy on how hashcode and equals are used in the storage and retrieval of objects in a collection.

Suppose you have a number of buckets in which your objects are going to be stored. The hashcode() method determines which bucket the object would go in to. As you will know different objects can end up with the same hashcode and thus would go into the same bucket as a different object.

When it comes to retrieving the object the hash code would tell us which bucket it is in. When it comes to finding the object that we are after we use the equals() method to go through the different objects to find the one we want.

Hope this helps.
The interfaces that you mentioned are referred to as marker interfaces. All they do is to indicate that an item is cloneable, or serializiable etc.

In your code you could check if something is cloneable by using the instanceof keyword.
It is generally considered that the Whizlabs exams are tougher than the SCJP exams. While this is generally true, what you may find when you take the exam is that the style of questions can be different to what you encounter in Whizlabs.
This shouldn't be a problem for you if you are passing the exams on Whizlabs - but it did come as a bit of a surprise when I did the exams myself.
I think you've posted this to the wrong forum.
13 years ago
I don't have the K&B book with me so I can't refer to chapter 10.

If you have '.' in your classpath it means the current directory that you're in. If for example you have a java class named Test.class in c:\prog and it references a jar file (lib.jar) in c:\jarfiles you'd want to use a classpath like:

set classpath=c:/jarfiles/lib.jar;.

assuming you are in c:\prog you should be able to run your class with

java Test

alternatively you could specify the classpath in the command line:

java -cp c:\jarfiles\lib.jar;. Test
You have got to practice, practice, practice.

You will usually find that looking at a bit of code in a book, or on a screen, that you can understand what it is doing. But when you come to write some code yourself that you don't understand the topic as well you thought you did. You forget the method names, what parameters the methods take, what exceptions they throw etc.
Suppose you define a class with some instance variables:



when you instantiate a Test object the testBucket instance variable is a reference to an instance of Bucket. The testBucket reference variable lives on the heap as it is a part of the Test object.

In the makeObject() method we are defining a reference variable that will point to a new instance of Bucket - this reference variable will live on the stack as it is a local variable. All local variable live on the stack.
If you spend time around this forum you will observe that many posters on here mention the K&B book. This is a study guide written by Kathy Sierra and Bert Bates - you will find it on Amazon.

Also check out Whizlabs preparation software.
You should receive a certificate from Sun up to 8 weeks after completing the exam - you shouldn't have to pay anything extra to get it.
13 years ago
What I found during my studies was that having exposure to different sets of questions helped in understanding concepts. The problem with going over the same set of questions all the time (as in the case of K&B) is that you just remember the answer you used last time you attempted that question rather than being taxed by the problem itself.
I purchased Whizlabs software about a year ago for my exam preparation and found it very useful. I can't remember receiving any spam however.