if u add an import stmt to an application
u can do the same by adding reference to the apllication

then what is the diff bet these two ?



if u add an import stmt to an application u can do the same by adding reference to the apllication..

Answer / praveen n h

when you add the dll reference to an application. It means
that you can use the classes in that namespace.
But if you don't mention the imports(vb)/using(c#) statement
wherever in your application you are referring to that class
you will have to mention the complete class name.
If you use the imports(vb)/using(c#) statement you can
directly mention the class name to use it.

for example
'with imports
imports test 'test is the DLL and it has addtion class in it
.....
class myclass
{
'to create an object of the addition class here is the stmt.
......
addition a = new addition()
.......
}


Without imports

class myclass
{
test.addition a = new test.addition()
}

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Dot Net Framework Interview Questions

Requirement is: try { \\SQL Query } catch(Exception i) { print a } catch(SQLQueryException e) { \\SQL Query } Qu)I Got Exception in "try" block. Which "catch" statement (i.e. 1st catch or 2nd catch ) catches the exception and Why???

6 Answers   3i Infotech,


What is web api‘s in asp.net mvc 4 ?

0 Answers  


how to disable the lazy loading framework?

0 Answers   Microsoft,


what are background threads? give ex?

3 Answers   CSC, Kanbay,


How do you do role based security ?

1 Answers   Accenture, BirlaSoft,






How to return the JSON from action method in ASP.Net MVC?

0 Answers  


What are Satellite Assemblies? How you will create this?

4 Answers  


can i change web.config settings from iis?

1 Answers   HCL, ReadySoft, Wipro,


How do assemblies find each other?

2 Answers  


Where are the value-type variables allocated in the computer RAM ?

1 Answers  


Is dapper better than entity framework?

0 Answers  


What is the 'page life cycle' of an ASP.NET MVC?

0 Answers   NA,


Categories