.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal

Home >> Interview Question >> .NET Framework >> Post New Question Subscribe to Interview Questions

Select the correct statement that sets the priority of a thread among a group of threads to maximum.

Posted By :Nikhil Kumar     Posted Date :August 30, 2010    Points :10   Category :.NET Framework 
1, threadObj.getPriority(THREAD.MAX_PRIORITY);
2, threadObj.setPriority(MAX_PRIORITY);
3, threadObj.setPriority(THREAD.PRIORITY);
4, threadObj.setPriority(THREAD.MAX_PRIORITY);

Answer : 4

You can also find related Interview Question to Select the correct statement that sets the priority of a thread among a group of threads to maximum.  below: 

Consider the following code:

public class Example extends Thread
public void run()
System.out.println ("Hello");

public static void main (String args[])
new Example();

Select the correct option regarding the preceding code ?

1, The code will not compile.
2, The code will compile but will not execute.
3, The code will compile, execute, and display Hello as the output.
4, The code will compile, execute, but will not display anything.

Answer : 4 (More...)

Consider the following two classes:

public class Example1
public static int num;

public class Example2
public static void main(String[] args)

Select the correct option regarding the preceding classes.?

1, The Example2 class will execute without any output.
2, The Example2 class will execute with the following output:5

3, The Example2 class will not compile as it does not calls the constructor of the Example 1 class.
4, The Example2 class will not execute as it does not calls the constructor of the Example 1 class.

Answer : 2 (More...)

What will be the result of the following statement?

SELECT STR(938.56, 6, 1)

A. 938.56
B. 938.5
C. 938.6
D. 0938.5
E. 0938.6
F. 00938.5
G. 00938.6

Correct Answer : C
The STR function returns character data converted from numeric data. The second parameter of the STR function is for the total length of the output, including the decimal point, sign, digits and spaces. The output is rounded to the number of decimal places specified in the third parameter.

What keyword does an SQL SELECT statement use for a string search?

The LIKE keyword allows for string searches. The % sign is used as a wildcard.


Minimum number of queues needed to implement the priority queue?

Two. One queue is used for actual storing of data and another for storing priorities. (More...)

What is a Thread ?

A thread is the basic unit to which the operating system allocates processor time. (More...)

Can we have multiple threads in one App domain ?

One or more threads run in an AppDomain. An AppDomain is a runtime representation of a logical process within a physical process. Each AppDomain is started with a single thread, but can create additional threads from any of its threads.
Note :- All threading classes are defined in System.Threading namespace. (More...)

How can we change priority and what the levels of priority are provided by .NET ?

Thread Priority can be changed by using Threadname.Priority = ThreadPriority.Highest. In the sample provided look out for code where the second thread is ran with a high priority.
Following are different levels of Priority provided by .NET :-
. ThreadPriority.Highest
. ThreadPriority.AboveNormal
. ThreadPriority.Normal
. ThreadPriority.BelowNormal
. ThreadPriority.Lowest (More...)

How can you reference current thread of the method ?

"Thread.CurrentThread" refers to the current thread running in the method."CurrentThread" is a public static property. (More...)

What's Thread.Sleep() in threading ?

Thread's execution can be caused by calling the Thread.Sleep method. This method takes an integer value that determines how long the thread should sleep. Example Thread.CurrentThread.Sleep(2000). (More...)

How can we make a thread sleep for infinite period?

You can also place a thread into the sleep state for an indeterminate amount of time by calling Thread.Sleep (System.Threading.Timeout.Infinite). To interrupt this sleep you can call the Thread.Interrupt method. (More...)

What the way to stop a long running thread ?

Thread.Abort() stops the thread execution at that moment itself. (More...)

What is Thread.Join() in threading ?

There are two versions of Thread.Join :-
. Thread.join().
. Thread.join(Integer) this returns a Boolean value.
The Thread.Join method is useful for determining if a thread has completed before starting another task. The Join method waits a specified amount of time for a thread to end. If the thread ends before the time-out, Join returns true; otherwise it returns False. Once you call Join, the calling procedure stops and waits for the thread to signal that it is done.
Example you have "Thread1" and "Thread2" and while executing 'Thread1" you call "Thread2.Join()".So "Thread1" will wait until "Thread2" has completed its execution and the again invoke "Thread1".
Thread.Join(Integer) ensures that threads do not wait for a long time. If it exceeds a specific time which is provided in integer the waiting thread will start. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend