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


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

What are undefined and undeclared variables?

Posted By :Akhil Raj     Posted Date :September 21, 2010    Points :10   Category :JavaScript/VBScript 
Undeclared variables are those that are not declared in the program (do not exist at all),trying to read their values gives runtime error.But if undeclared variables are assigned then implicit declaration is done .
Undefined variables are those that are not assigned any value but are declared in the program.Trying to read such variables gives special value called undefined value.

You can also find related Interview Question to What are undefined and undeclared variables?  below: 

Are private class-level variables inherited?

  
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. (More...)

Are private class-level variables inherited?

  
Yes, but they are not accessible, so looking at it you can honestly say that they are not inherited. But they are. (More...)

DateTime variables can be null (True / False )

  
False

The DateTime type is a non-nullable value type, and just like an integer, it cannot be assigned to null. (More...)

How to print out all the variables in the Session?

  
Yes, Using "Session.Keys" we can get all session variables

In VB.NET

Dim strSesVar as string
For Each strSesVar In Session.Keys
Response.Write(strSesVar + " : " + Session(strSesVar).ToString() + "
")
Next


In C#

foreach (string strSesVar in Session.Keys)
{
Response.Write(strSesVar + " : " + Session[strSesVar].ToString() + "
");
} (More...)

Which file sets the environment variables for Visual Studio?

  
The vsvars32.bat sets the environment variables for Visual Studio. You can find it from %Microsoft Visual Studio 2008\Common7\Tools\vsvars32.bat.

When you start the Visual Studio 2008 command prompt it automatically runs vsvars32.bat. (More...)

Can we have a variables inside the interface?

  
no, we can have only methods, properties, indexers and enums inside the interface. (More...)

Can we have a variables inside the interface?

  
no, we can have only methods, properties, indexers and enums inside the interface.
(More...)

What is the difference between undefined value and null value?

  
Undefined value: A value that is not defined and has no keyword is known as undefined value. For example in the declaration, int number; the number has undefined value.

Null value: A value that is explicitly specified by the key word 'null' is known as null value. For example in the declaration, String str=null; the str has a null value. The keyword 'null' is used here. (More...)

How To Get All Session Variables And Values?

  
string SessionVariableName;
string SessionVariableValue;

foreach (string SessionVariable in Session.Keys)
{
SessionVariableName = SessionVariable;
SessionVariableValue = Session[SessionVariableName].ToString();

}

(More...)

Where does Static variables store ?

  
Static variables are stored on the Heap of the memory. It is not dependent on whether it is declared within a reference type or a value type.

These variables will be in the memory till the time program ends. (More...)

Can we declare variables with xml data type?

  
Yes, variables can be declared of xml data type that can hold xml data (More...)

Are private class-level variables inherited?

  
Yes,private class members are inheritable, but they are not accessible (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