• Post Reply Bookmark Topic Watch Topic
  • New Topic

plz i need ans to the following questions  RSS feed

 
tania khan
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have few questions. i would be thankful if anyone ans my questions
my first question is
Q WHICH OF THE FOLLOWING THREADS WILL MOST LIKELY TO RUN FIRST?
a- a finished thread with priority of MAX-PRIORITY.
b- a runable thread with priority of 1
c- a runnable thread with priority of 2
d- suspended thread with priority of 5
plz define the term " runnable" precisely. i think here it means the thread which is in ready to run position" am i right?
my second question is :-
Q WHICH OF THE FOLLOWING IS NOT A VALID STATE OF THREAD?
a dead
b running
c runnable
d altered
my third question is :-
Q CAN INHERITED SYNCHRONIZED METHOD HAVE ITS MODIFIER CHANGED IN THE SUBCLASS ?
 
Anthony Villanueva
Ranch Hand
Posts: 1055
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
plz define the term " runnable" precisely. i think here it means the thread which is in ready to run position" am i right?

Yes.
Q WHICH OF THE FOLLOWING THREADS WILL MOST LIKELY TO RUN FIRST?
a- a finished thread with priority of MAX-PRIORITY.
b- a runable thread with priority of 1
c- a runnable thread with priority of 2
d- suspended thread with priority of 5

If by a finished thread you mean a thread that has completed execution of its run() method then it's, uh, out of the running. A supended thread will not become runnable again unless it is revived with resume(). So you are left with b and c. Whoever runs first is really at the mercy of the thread scheduler, which is implementation-dependent. But since we are talking about likelihood instead of certainties, I'll place my bet on c.
my second question is :-
Q WHICH OF THE FOLLOWING IS NOT A VALID STATE OF THREAD?
a dead
b running
c runnable
d altered

What on earth is altered?
my third question is :-
Q CAN INHERITED SYNCHRONIZED METHOD HAVE ITS MODIFIER CHANGED IN THE SUBCLASS

A method that overrides a synchronized method may or may not be synchronized.
-anthony
[ April 01, 2002: Message edited by: Anthony Villanueva ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!