Win Surprise Gifts!!!
Top 5 Contributors of the Month
Post New Question
Subscribe to Interview Questions
Namespace for the Thread Class?
Posted By :
Posted Date :
January 03, 2011
All threading classes are defined in System.Threading namespace.
You can also find related Interview Question to
Namespace for the Thread Class?
Which namespace is the base class for .net Class library?
What namespace does the Web page belong in the .NET Framework class hierarchy?
Can you write a class without specifying namespace? Which namespace does it belong to by default??
Yes, you can, then the class belongs to global namespace which has no name. For commercial products, naturally, you wouldn't want global namespace
Consider the following code:
public class Example extends Thread
public void run()
public static void main (String args)
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
Can namespace contain the private class?
no, having a single private class does not mean anything , it is applicable only in case of nested class.
Why Runnable interface is preferable than extending the Thread class?
Runnable interface is always preferred because, the class implementing it can implement as many interfaces as a developer can, and also extend another class. Whereas extending the Thread class, it can not extend another class, as Java supports only single inheritance.
What is Active Directory? What is the namespace used to access the Microsoft Active Directories? What are ADSI Directories?
Active Directory Service Interfaces (ADSI) is a programmatic interface for Microsoft Windows Active Directory. It enables your applications to interact with diverse directories on a network, using a single interface. Visual Studio .NET and the .NET Framework make it easy to add ADSI functionality with the DirectoryEntry and DirectorySearcher components.
Using ADSI, you can create applications that perform common administrative tasks, such as backing up databases, accessing printers, and administering user accounts.
What is the difference between a Struct and a Class?
The struct type is suitable for representing lightweight objects such as Point, Rectangle, and Color. Although it is possible to represent a point as a class, a struct is more efficient in some scenarios. For example, if you declare an array of 1000 Point objects, you will allocate additional memory for referencing each object. In this case, the struct is less expensive.
When you create a struct object using the new operator, it gets created and the appropriate constructor is called. Unlike classes, structs can be instantiated without using the new operator. If you do not use new, the fields will remain unassigned and the object cannot be used until all of the fields are initialized.
It is an error to declare a default (parameterless) constructor for a struct. A default constructor is always provided to initialize the struct members to their default values.
It is an error to initialize an instance field in a struct.
There is no inheritance for structs as there is for classes. A struct cannot inherit from another struct or class, and it cannot be the base of a class. Structs, however, inherit from the base class Object. A struct can implement interfaces, and it does that exactly as classes do.
A struct is a value type, while a class is a reference type.
Can we call a base class method without creating instance?
Its possible If its a static method.
Its possible by inheriting from that class also.
Its possible from derived classes using base keyword.
What is Private Constructor? and it's use? Can you create instance of a class which has Private Constructor?
When a class declares only private instance constructors, it is not possible for classes outside the program to derive from the class or to directly create instances of it. (Except Nested classes)
Make a constructor private if:
1) You want it to be available only to the class itself. For example, you might have a special constructor used only in the implementation of your class' Clone method.
2) You do not want instances of your component to be created. For example, you may have a class containing nothing but Shared utility functions, and no instance data. Creating instances of the class would waste memory.
What event class gives a description about the type of a mousebutton pressed ?
How can you prevent a class from inheriting?
Using Sealed keyword
What is the difference between interface and abstract class ?
a class may inherit several interfaces, a class may inherit only one abstract class
What is the default access specifier for a top level class which are not nested into other class?
Quick Links For Interview Questions Categories:
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
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
Terms of Service
Tell A Friend