CoolInterview.com - World's Largest Collection of Interview Questions & Answers, FAQs, queries, sample papers, exam papers, dumps, what, why, how, where, when questions
Interview Success Kit - Get Success in Job Interviews Interview Success Kit - 30,000 Interview Que. & Ans.
Covers 30,000+ Interview Questions asked in actual MNC Interviews - all with model answers.
Get Your Dream Job Now - www.vyoms.com
Sponsored Links
Interview Questions
Our Services

INTERVIEW QUESTIONS CERTIFICATIONS SUN CERTIFIED JAVA DEVELOPER DETAILS
Question :
Given:
11. class PingPong2 {
12. synchronized void hit(long n) {
13. for(int i = 1; i < 3; i++)
14. System.out.print(n + "-" + i + " ");
15. }
16. }
17. public class Tester implements Runnable {
18. static PingPong2 pp2 = new PingPong2();
19. public static void main(String[] args) {
20. new Thread(new Tester()).start();
21. new Thread(new Tester()).start();
22. }
23. public void run() { pp2.hit(Thread.currentThread().getId()); }
24. }
Which statement is true?
A. The output could be 5-1 6-1 6-2 5-2
B. The output could be 6-1 6-2 5-1 5-2
C. The output could be 6-1 5-2 6-2 5-1
D. The output could be 6-1 6-2 5-1 7-1


Category Sun Certified Java Developer Interview Questions
Rating (2.8) By 16 users
Added on 7/20/2015
Views 34
Rate it!
Answers:

B:The output could be 6-1 6-2 5-1 5-2



If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-

  • There should not be any Spelling Mistakes.
  • There should not be any Gramatical Errors.
  • Answers must not contain any bad words.
  • Answers should not be the repeat of same answer, already approved.
  • Answer should be complete in itself.
  • Name :*
    Email Id :*
    Answer :*
    Verification Code Code Image - Please contact webmaster if you have problems seeing this image code Not readable? Load New Code
    Process Verification Enter the above shown code: *
    Inform me about updated answers to this question

    Related Questions
    View Answer
    QUESTION 3
    Given:
    7. void waitForSignal() {
    8. Object obj = new Object();
    9. synchronized (Thread.currentThread()) {
    10. obj.wait();
    11. obj.notify();
    12. }
    13. }
    Which statement is true?
    A. This code can throw an InterruptedException.
    B. This code can throw an IllegalMonitorStateException.
    C. This code can throw a TimeoutException after ten minutes.
    D. Reversing the order of obj.wait() and obj.notify() might cause this method to complete normally.
    E. A call to notify() or notifyAll() from another thread might cause this method to complete normally.
    F. This code does NOT compile unless "obj.wait()" is replaced with "((Thread) obj).wait()".

    View Answer
    Which two statements are true? (Choose two.)
    A. It is possible for more than two threads to deadlock at once.
    B. The JVM implementation guarantees that multiple threads cannot enter into a deadlocked state.
    C. Deadlocked threads release once their sleep() method's sleep duration has expired.
    D. Deadlocking can occur only when the wait(), notify(), and notifyAll() methods are used incorrectly.
    E. It is possible for a single-threaded application to deadlock if synchronized blocks are used incorrectly.
    F. If a piece of code is capable of deadlocking, you cannot eliminate the possibility of deadlocking by inserting
    invocations of Thread.yield().

    View Answer
    Given:
    1. public class Threads2 implements Runnable {
    2.
    3. public void run() {
    4. System.out.println("run.");
    5. throw new RuntimeException("Problem");
    6. }
    7. public static void main(String[] args) {
    8. Thread t = new Thread(new Threads2());
    9. t.start();
    10. System.out.println("End of method.");
    11. }
    12. }
    Which two can be results? (Choose two.)
    A. java.lang.RuntimeException: Problem
    B. run.
    java.lang.RuntimeException: Problem
    C. End of method.
    java.lang.RuntimeException: Problem
    D. End of method.
    run.
    java.lang.RuntimeException: Problem
    E. run.
    java.lang.RuntimeException: Problem
    End of method.

    View Answer
    how to include the input of the output file in java script?
    View Answer
    What is the result of mounting a file system with thenoatimeoption enabled?
    A.It enables the UFS logging
    B.It disables the update of file access times
    C.It prevents the creation of files larger than 2Gbytes
    D.It prevents the user from updating the file modification times
    View Answer
    IF you are remotely logged on to a Solaris machine, What command would you execute?
    View Answer
    What is native keyword and abstract keyword?
    View Answer

    Please Note: We keep on updating better answers to this site. In case you are looking for Jobs, Pls Click Here Vyoms.com - Best Freshers & Experienced Jobs Website.

    View ALL Sun Certified Java Developer Interview Questions & Answers

    User Options
    Latest 20 Questions
    How to Retrieve a Cookie Value ?
    How to Create a Cookie?
    What is ViewState ?
    What are different methods of session maintenance in ASP.NET?
    What is cross cutting concern and concern in spring AOP ?
    What are the important beans lifecycle methods ?
    Explain the advantages of using DAO module?
    What is SQLProvider ?
    How struts application can be integrated with spring?
    What are the advantages of spring framework?
    What is ?Throws advice? in Spring ?
    What is Metadata Autoproxying ?
    Describe about DAO in Spring framework ?
    What is called an Advice ?
    What is IOC?
    What are the types of Dependency Injection?
    What are the different Modes of Autowiring ?
    Define Application context module?
    Why Spring framework is needed?
    What is called Spring MVC?


    Copyright ©2003-2016 CoolInterview.com, All Rights Reserved.
    Privacy Policy | Terms and Conditions

    Download Yahoo Messenger | Placement Papers| FREE SMS | ASP .Net Tutorial | Web Hosting | Dedicated Servers | C Interview Questions & Answers

    Testing Articles | Testing Books | Testing Certifications | Testing FAQs | Testing Downloads | Testing Interview Questions | Testing Jobs | Testing Training Institutes


    Cache = 0.015625 Seconds