Armel Moukoss

Greenhorn
+ Follow
since Mar 28, 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 Armel Moukoss

Thank you Alejandro for your help, but i am still confused. I would be glad to receive others helps. Thank you.

Armel
Hello,

i need your help, i don't understand the output of this code. Can you help me please ?

<CODE>
class Parent
{
private void method1() // the method is private
{
System.out.println("Parent's method1()");
}
public void method2()
{
System.out.println("Parent's method2()");
System.out.println(this);
method1();
}
}

class Test extends Parent
{
public void method1()
{
System.out.println("Test's method1()");
}
public static void main(String args[])
{
Parent p = new Test();
p.method2();
}
}
</CODE>

I have this as output in my computer :

Parent's method2()
Test@18d107f
Parent's method1()

I think, it shoul be :

Parent's method2()
Test@18d107f
<BOLD> Test's method1() </BOLD> because the object executing method2() is Test@18d107f

Thank you very much.

Armel
Hi everyone,
I don't understand why this code produce this result : d a .
I think, il would be : d d. Thank you for your help.

Armel

Hi Olivier,

Firstly congratulation for your amazing score !!! I am in paris and i would take the exam for the end of month, but i don't know which is the best exam center in Paris. Which exam center did you take the SCJP ?
Thank you for your answer and the tips you gave in your previous post.

Armel
16 years ago
Thank you Manfred Klug for your help.

Armel
I have another question if i delete the notify() method in class ThreadB i have the same result. I thought that without notify in class ThreadB, the class ThreadA will still wait. ThreadA complete his synchronized code without any problems.

Do you have any answer for this question ? Thank you.

Armel
thank you guys for your help !!!

Armel
hi,

I need your help, I don't understand the way this code works.
I thought that after writting b.start(); the code within the run() method
will be excuted.But it's excuted only later in synchronized.why ?






This is the output :

total value before the start method :0
total value after the start method :0
Waiting for b to compl�te ..
***********In the run method****************
After the wait
Total is : 4950
***************End of the run method******************
total value in synchronized method :4950

I have looked for in the old posts and i find one about this problem but the answer wasn't clear. Thank you for your help.

Armel
Thank you Mar for your help.

Armel
Hi everyone,
Can someone, please, explain me why I have a running error with this code :


the error is :

Exception in thread "main" java.util.ConcurrentModificationException
at java.util.AbstractList$Itr.checkForComodification(Unknown Source)
at java.util.AbstractList$Itr.next(Unknown Source)
at Test.main(Test.java:21)

Thank you for your help.

Armel

Edit by mw: Fixed code tags. (Tags in these forums use square brackets [] instead of angled brackets.)
[ June 20, 2007: Message edited by: marc weber ]
Hi,

Just to thank you very much guys for yours answers.

Armel
Hi,

I don't really understand how the toString method is used in the code below :

One of the possible result :


Initial State: [k, q, i, j, f, V, J, S, c, v, u', U, C, z, I, y, d, H, X, e]
Sorted: [C, H, I, J, S, U, V, X, c, d, e, f, i, j, k, q, u', v, y, z]
Reversed: [z, y, v, u', q, k, j, i, f, e, d, c, X, V, U, S, J, I, H, C]



I don't see any place where the toString method is called. But if i put it in commentary the result is not the same. Can someone help me, please ? thank you.

Ps : I take the code on the cd of the book "complete java 2 certification", in solution of the chapter 8.
Thank you to everyone for your answer. I thought that the equals method was the same for Object, Integer,.. and so one. But i was wrong. thank you !!!
Hi everybody,
Can anyone explains the result of this code :

public class Reference {
public static void main (String Args [] ){
Reference t1 = new Reference ();
Reference t2 = new Reference ();

if (t1.equals(t2)){
System.out.println ("Same content");
}else{
System.out.println ("Different content");
}
}
}
the output is : Different content. I thought it would be Same content.
Thank you