Working With VISUALSTUDIO .NET – it’s an editor used for developing .net application in any
.net language like C#, VB etc. as well as any type of application like console,
windows , web etc.
Versions of VISUAL STUDIO .NET –
YEAR
|
Version
|
2002
|
framework 1.0
|
2003
|
framework 1.1
|
2005
|
framework 2.0
|
2008
|
framework 3.5
|
2010
|
framework 4.0
|
- TO open VS go to start menu programs ms visual studio ms visual studio and click on it to open.
- Applications developed under visual studio are known as Projects” where a “project” is the collection of various files or items. To create a project either click on new project option or go to file menu select new project, which opens new project window.
- under new Project window we need to specify the following details
- In the LHS chose the language in which we want to develop the application eg Visual C# .
- In the middle chose the type of application we want to develop by choosing a project template. eg – console application.
- In the bottom specify a name to the project. eg – SampleProject.
- Below project name specify the location where to save the project. eg- C:\CSharp4
4. click on OK button which creates the project with a default
class program under the file Program.cs
5. When projects are developed in VS by default a Namespace is
gets created with same name of the Project i.e. SampleProject. From now each
and every class of the project comes within the same name space.
NOTE - a Namespace is a logical continuer of types.
6. Now under Main method of Program Class write the following
code.
Console.WriteLine(“My first Project”);
Console.WriteLine();
7. To run the class either presses F5 or ctrl + F5 or Click on
start debugging button on top of the studio which will saved compile and
executes the program.
8. under VS we find a window known as “ Solution Explorer” used
for organizing the complete application, which allows to view, add or Delete
items under the project, to open ”solution" explorer go
to view menu and select “solution Explorer “
9. to add new class under project open solution explorer Right
click on Project select add new item which
opens add new item window select
class template in it specify a name in the bottom click
on add button which add the class under project eg- class1.cs
Note – the new class added also comes under the same Namespace.
10. Now under the class write following code.
static void Main ()
{
Console.WriteLine(“second
class”);
Console.ReadLine();
}
11.To run the class open Solution Explorer right
click on the Project select properties which opens project property window under
it we find an option startup objects which lists all the classes of project that contains a valid main method in them choose
your class and run.
Objects Oriented Programming – It is an approach that came into existence in 70th to resolve the drawbacks of
traditional procedural approach i.e. security and reusability.
Object Oriented Languages provides Security and
Reusability under them we can call a language as OO provided it satisfied the
principals of the approach, those are –
- Encapsulation.
- Abstraction.
- Inheritance.
- Polymorphism.
Abstraction – is all about hiding the complexity, behind the code by
providing a set of interfaces used for consuming the functionality. Methods are
the best example for abstraction because we never know what is the underling
code in it, what we required to know only how to invoke it.
Inheritance - provides code reusability which
can be used for consuming members of a class from other class by stabilizing
parent/child relation between classes.
Polymorphism – is an approach which tells entities behaves in different ways depending
upon the inputs it receives i.e. whenever the input changes the output and the
behavior of the entity also changes, which can be implemented using approaches
like Overloading and overwriting.
No comments:
Post a Comment