Showing posts with label class. Show all posts
Showing posts with label class. Show all posts

Saturday, March 1, 2014

OOP Development

Class Definition Syntax:

      class classname
       {
          //fields
          //properties
          //methods
       }

Fields Declaration Syntax:

accessmodifier  functionalModifier  datatype variablename;
(or)
accessmodifier functionalModifier datatype variablename = value;
Note 1: We cover about ―Properties‖ syntax in further hours.
Note 2: The functional modifiers are static, readonly, virtual, override. We cover about these modifiers also   in further hours.

Methods (Member Functions) Declaration Syntax:

accessmodifier  functionalModifier  returntype/void methodname(args)
{
//method body
}

Object (Instance) Construction Syntax:

//object reference creation
classname objname;
//memory allocation
objname = new classname();
      (  or )
//object creation along with memory allocation
classname objname = new classname()

Accessing Object Members:


     obj.field
     obj.property
     obj.method()

Object Oriented Programming

Downlaod above code for OOPS Demo : Download Links

Introduction to OOPS

Introduction to Object Oriented Programming

Types of Programming Languages:

  • Structure Oriented Programming Language:
             The  programming  implementation  flow  depends  on  structures.  That means  you  need  to create  the structures  for  each  data  entity.  Those structure members can be created in the  individual functions.
             Ex: Pascal, C, C++ etc.
  • Object Oriented Programming Languages:
The  programming  implementation  flow  depends  on  classes.  In  the main()  method,  you  need  to create  the  instances  for  the  classes  and access those methods. These instances are called "Objects".
Ex: C++, VC++, Java and all .NET languages.
The "OOP" is a new type of programming style, introduced in 1980‘s.

Basic Terminology in OOP Languages:

  • Class:
A class describes about the logical structure of an object. That means it describes about the data to be stored in the in an object and also some operations, that are to be performed on that data. No memory will be allocated for the class. In other words, a class is used to classify the objects.
   Syn:
          class classname
             {
                //fields
                //properties
                //methods
             }
  • Field / Data Member:
A  variable,  declared  inside  of  the  class  is  called  as  "field"  / "data member". The fields are used to store the data values.
  • Property:
It‘s an extension to the field, which automatically performs the specified code, whenever its value is changed.
  • Method / Member function:
It‘s also called as operation / member function. A method is nothing but a function, which is defined inside of the class. It is used to perform some process on the data members.
  • Object:
It‘s an instance of the class. It‘s required because, no memory will be allocated for the class, so   that 
you can‘t store any data and you can‘t call any operation. It is similar to "structure variables", which is declared for the "structure". The  actual  memory  will  be  allocated  for  the  object,  which  includes  with 
all the data members. The object can access the members that are defined in the class.
object
By default, the objects are isolated. That means there is no any relation between the data stored in one object and another object.
object

Friday, February 21, 2014

Visual Studio 2010 - Part 1

How to open Visual Studio 2010 is Click on Start Menu  -> Programs‖  –> Microsoft Visual Studio 2010  –> Microsoft Visual Studio 2010.
  • The following screen will be opened
  • Initially, the Visual Studio 2010 will be opened along with Start Page.
  • The start page is nothing but the welcome page, which contains
  1.  Logo: A logo of Microsoft Visual Studio 2010‖ on the top of the start page.
  2. Recent Projects: List of most recently opened projects. If you click on any one, the project will be opened immediately.
  3. Get  started  / Guidance and Resources / Latest News:  Headlines of visual studio help for .NET  programmers. If you click on any one head line, online help will be opened (if Internet connection is available)

The Visual Studio 2010 Basics

To  start  programming  with  Visual  Studio,  you  should  know  some  common  terminology that is used most frequently in Visual Studio.
  • Project:  An  application  developed  in  Visual  Studio.  That  may  be  of  different types  such  as  Console  application,  Windows  application,  Windows  Service,  Web site etc.
  • Solution:  Collection of one or more projects. Initially, in a solution, one project will be placed. Later, you can add other projects to it.
  • Build:  Compilation  of  entire  .NET  Project  (all  the  files  will  be  compiled  at-atime).
  • Class: A collection of data members and methods (member functions).
                   Example of the Class

  • Namespace:  It‘s  nothing  but  a  collection  of  classes.  It  may  also  contain  sub namespaces.  A  project  may  require  implementing  at  least  one  or  more  classes. Any class can‘t be defined individually, without a namespace.  In .NET, all of the classes related one application should be defined with a user defined namespace.
               Example of Namespace

Continue for Next Page Click Here
Flag Counter