This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice this week in the Spring forum!

Anvi Dixit

Ranch Hand
+ Follow
since Aug 28, 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 Anvi Dixit

Hello Everyone,

Can anyone tell me what is Weblogc Portal and what is portlet.
Also what is need to install the portal, infact the basic knowledge of portal. I also need to install the workshop for weblogic portal. How can i do that?

Thanks in Advance
Anvi Dixit
14 years ago
Hi All,

I purchased the Whizlab kit and i got the confirmation mail, but i didnt got the license key and number in that mail . Please let me know if the same thing happens with you also or not. And if not what should i do now.

I am quite worried.


Thanks
Anvi
Thanks Nitin and Rahul for your quick response. But i am still confuse with the logic of release and notify.

Let say we have a Thread A waiting on a particular object say B.Below code will come under the synchronized code:


At this point we have few things.
  • Thread A release the lock on object B.
  • On exit of the synchronized code Thread A will release the lock on object B.[which is not possible here since here the status of thread is block.]
  • Lock is released but still the waiting Thread A will not return to runnable state, unless B is notified.

  • Now here I think if the thread release the lock on object B tha means any other thread can acquire the lock on object B. Rigth?

    Please let me know the points i have wrote down is correct or not?
    thanks
    Anvi
    Hi Ranchers,

    Find below the question

    A. The notifyAll() method must be called from a synchronized context.
    B. To call wait(), an object must own the lock on the thread.
    C. The notify() method is defined in class java.lang.Thread.
    D. When a thread is waiting as a result of wait(), it release its lock.
    E. The notify() method causes a thread to immediately release its lock.
    F. The difference between notify() and notifyAll() is that notifyAll() notifies all waiting threads, regardless of the object they're waiting on.

    and the answers for the above are A and D. I understand the first answer is correct. but how the option D is correct.

    According to my knowledge Thread can oly release its locks by exiting the synchronized code.
    I am confused. Let me know what is correct.

    Thanks
    ANVI
    Hi Ranchers,

    Find below the question

    A. The notifyAll() method must be called from a synchronized context.
    B. To call wait(), an object must own the lock on the thread.
    C. The notify() method is defined in class java.lang.Thread.
    D. When a thread is waiting as a result of wait(), it release its lock.
    E. The notify() method causes a thread to immediately release its lock.
    F. The difference between notify() and notifyAll() is that notifyAll() notifies all waiting threads, regardless of the object they're waiting on.

    and the answers for the above are A and D. I understand the first answer is correct. but how the option D is correct.

    According to my knowledge Thread can oly release its locks by exiting the synchronized code.
    I am confused. Let me know what is correct.
    Hi All.

    here is my question.

    Which of the following statements are true?
    1.To be overridden a method must have the same name, parameter types and return type
    2.It is possible to override methods in a superclass or the same class
    3.classes that are marked as final may not be extended. - true
    4.an overriding method cannot have more access (be more public) than the method being overriden.

  • [list]As of java 1.4 option 1 is correct. what would be the statement as of java 5.0 then?
  • option 4 - quite confused with the terms overriding and overriden.


  • thanks
    Anvi
    Thanks Keith and Cory .

    I got ..infact i missed out that the bracket is for the SOP.

    Thanks again
    Anvi
    Hello Everyone,

    Please find below the question asked in the K & B book.

    now here the answer is E. But there is a mistake . please have a look on the statement.

    System.out.println(new Runnable() {public void run() { }});

    just before the semicolon there is a bracket ), which should not be there as i believe.
    Please let me know whether i am correct or not.

    Thanks in advance
    Anvi Dixit
    Hi Andy,

    yes you are right. there was a problem with the 's'. Lets analyse the code.

    for the x=1 , a[1] = new Dog() and hence we can write
    Animal a = new Dog();
    a.doStuff();//which will invoke the static method of the Dog class.

    output will be d:

    why then its showing the output d:a:.
    Please explain.


    Anvi
    Hello Ranchers,

    There is rule that static method cannot be override but it can be redefine. I am confused with this.Please find below the code and let me know how it works and why.



    The output for this is :
    a:if not
    a:a:if instance of dog
    a:if not


    please explain how the second output a:a:if instance of dog generates. Also let me know if i need the output as a :a:

    Please help me

    Thnaks in advance
    Anvi Dixit
    Hi Damodar,

    If you can send us the full code, so it will be useful for us to know exact problem in the code.

    Thanks
    Anvi
    Thanks to All,

    I understood the problem that while calling the go method (bm.go()) it was called from the bm instance's context and not from the static context and thats why even the go method is non static it's not giving any error.

    Thanks again
    Anvi
    hello

    please find below the code.


    This code will compile fine but give run time exception. I agree with that but i still believe that there should be a compile time error with this code at line 1, since bm.go() calls method public void go() which is not static.

    Also go() calls start() method which is not static . Hence we can't make the line no 2 public static void go() which will give compilation error.

    Please let me know the exact problem here


    Thanks in advance
    Anvi
    Hello,

    i would like to know did you purchase the JQL exam , because i am planning to give exam in the last week of march so i need to know how would i proceed further with these.

    Also if you have other exams let me know about that.

    Thanks
    Anvi