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 ?

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is .net framwork?

727


What are ajax helpers in mvc?

704


What are the possible razor view extensions?

764


What filters are executed in the end?

763


Explain the new features added in version 4 of mvc (mvc4)?

752


How do you handle variable number of segments in a route definition?

736


what is more complex to implement property, methods or event? how can I define criteria to compare the difficulty of implementation between them? for example the number of methods wanted to implements property is 2 methods. how many methods I need it to implements events?

1940


Can we have enum in entity framework?

785


What are the components required to create a route in mvc?

804


What is route config?

722


The order of the filters that get executed, if the multiple filters are implemented?

805


What “beforFilter()”,“beforeRender” and “afterFilter” functions do in Controller?

753


What is partialview in asp.net mvc?

786


What is .net architecture and framework?

771


What are the two ways to add constraints to a route?

732