• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

Question

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1)Choose the correct statement about gridbag layout:
A. The weightx & weighty should have values between 0.0 & 1.0
B. If you specify the fill field is BOTH, there is no meaning to set anchor field
C. If you specify anchor field there is no meaning to set fill field is BOTH
Answer is A,B,C.I try it and find no one correct.Am I right?
2)What is the method used to schedule a thread for execution?
Answer is public void run(){}.I think is start();
3)Choose the correct one about thread:
A. The threads from one class ends at the same time.
B. when JVM exists the main method, it will stop only after all the
threads are stopped.
C. if there are multiple threads, reading or writing of data of class
is inconsitent.
D. programmer has to write a special program for garbagecollection in
multiple threads.
Answer is B,C.I think only C is correct.
4)Which statements are true about listeners?
A. The return value from a listener is of boolean type.
B. Most components allow multiple listeners to be added.
C. A copy of the original event is passed into a listener
method.
D. If multiple listeners are added to a single component,
they all must all be friends to each other.
E. If the multiple listeners are added to a single component,
the order [in which listeners are called is guaranteed].
Answer is B,C.I see other answer only B is correct.Whether C is answer?
5)What might cause the current thread to stop executing?
A. An InterruptedException is thrown
B. The thread executes a sleep() call
C. The thread constructs a new Thread
D. A thread of higher priority becomes ready (runnable)
E. The thread executes a read() call on an InputStream
Answer is A,B,D,E.I think is only B,D.
6)Which statement is true about an inner class?
A. It must be anonymous
B. It can not implement an interface
C. It is only accessible in the enclosing class
D. It can only be instantiated in the enclosing class
E. It can access any final variables in any enclosing scope.
Answer is E.I think No one is correct.
7)Consider the following code:
1. public void method(String s){
2. String a,b;
3. a = new String("Hello");
4. b = new String("Goodbye");
5. System.out.println(a + b);
6. a = null;
7. a = b;
8. System.out.println(a + b);
9. }
where is it possible that the garbage collector will run the first time?
A. Just before line 5
B. Just before line 6
C. Just before line 7
D. Just before line 8
E. Never in this method
Answer is C.I see other answer is B.I don't know which is correct.
 
Desperado
Posts: 3226
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please register with your real name and also post only one question per post. Thanks.
 
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know Anonymous innerclasses can extend a class or implement an interface.
Can any one help me what is the syntax to define such an anonymous inner class.
Thanks in advance,
Bala
 
Bala Raj
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am sorry that I posted a new question as a reply to this question
SO PLEASE disregard my previous posting.
Sorry for the inconvenience.
Bala
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic