1) There are 10 different threads in runnable state. Each
having priority 1 to 10. How does the CPU schedules or
executes these threads?

Answer Posted / shiv

At any given time the highest priority thread will always
be in a execution state. if there are more than one threads
with same priority then JVM decides which one should be
executed first. Thus if the priority is from 1..10 the they
will be scheduled for execution in a reverse manner.

Is This Answer Correct ?    10 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How does class forname work in java?

698


What are the different tags provided in jstl?

750


What is a top level class in java?

724


Why are global variables used?

705


How do you detect memory leaks?

769


What are the 3 types of loops in java?

712


What is the purpose of a volatile variable?

750


Can we convert list to set in java?

726


What is cr keyboard?

845


What is string :: npos?

771


What is variable in java?

720


What is null statement?

760


What is difference between c++ and java ?

856


Is there any way to find whether software installed in the system is registered by just providing the .exe file? I have tried the following code but its just displaying the directory structure in the registry. Here the code : package com.msi.intaller; import java.util.Iterator; import ca.beq.util.win32.registry.RegistryKey; import ca.beq.util.win32.registry.RootKey; public class RegistryFinder { public static void main(String... args) throws Exception { RegistryKey.initialize(RegistryFinder.class.getResource("jRe gistryKey.dll").getFile()); RegistryKey key = new RegistryKey(RootKey.HKLM, "Software\\ODBC"); for (Iterator subkeys = key.subkeys(); subkeys.hasNext();) { RegistryKey subkey = subkeys.next(); System.out.println(subkey.getName()); // You need to check here if there's anything which matches "Mozilla FireFox". } } }

1538


Can we extend singleton class?

709