Olivier Lambert

Greenhorn
+ Follow
since Apr 30, 2004
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 Olivier Lambert

Hello,

C is not true because assertions are only used to validate parameters of PRIVATE methods. Parameters of PUBLIC methods should be validate returning an exception.

A is effectively true because we can decide to enable or disable assertions class by class, package by package, ...

Hope it helps !
You can't define a method both abstract and synchronized. Abstract implies that your method has no body while synchronized says that the body of your method is "secured" ...
String s1,s2,s3,s4; => Nothing is created
s1 = "Hello"; => String object "Hello" is created
s2 = s1; => Nothing is created
s3 = s2 + "Pal"; => String objects "Pal" and "HelloPal" are created
s4 = s3; => Nothing is created

=> 3 objects are created, "Hello", "Pal" and "HelloPal".

Have a nice day!
By default, a floating point number is a double. If you want a float, you have to put a "f" next to your number.

example:
10.2, 12.36 are doubles,
25.689f is a float.
Hello,

When you enter in the method "method", there is only 1 object in memory (the one with the value "StringBuffer") but 2 references to this object (sb in the main andthe local variable sb in the method parameter).

Ref sb (from main method) ---> "StringBuffer"
Ref sb (from method method) ---> the same object

So when you call sb.append(...) in the method "method", it's the original object that is modified =>StringBufferAppend. At this time we have in memory:

Ref sb (from main method) ---> "StringBufferAppend"
Ref sb (from method method) ---> the same object

Then when you create a new object and assign it to sb, it is the local reference that is modified, not the reference from the variable of the main method. The result in memory is:

Ref sb (from main method) ---> "StringBufferAppend"
Ref sb (from method method) ---> "Hai"

So when you leave the method "method", the variable sb reference already the same object, that has been modified.

Hope it can help.
It means that class B is a specialisation of class A.

For example. A is Vehicle and B is Car.

B is a A
a Car is a Vehicle

But

A is not B
a Vehicle is not a Car

So you can assign a Car object into a Vehicle reference, but not a Vehicle object into a Car reference.

I hopes it can help you
Hello Phil,
I decided to pass this first certification because I think it can help to find a new job (the company where i worked fell into bankruptcy the second day of march). So i decide to pass the exam immediately. I just red the book from Kathy Sierra & Bert Bates and i passed the SCJP on march the 17th.
Then i began to work at smals ... on april the 15th... And i'm now learning with you to become an architect ... It's an interesting challenge i think...
I would like to pass the Web component certification, but it 'll not be possible for the moment because i have to read some books (about ebj and architectural patterns) for your next courses at smals.
See you soon !
[ May 03, 2004: Message edited by: Olivier Lambert ]
19 years ago
You are right :
public synchronized void test()
{}
is the same as
public void test()
{
synchronized (this)
{
}
}
Passed with 95% (58/61)
19 years ago