* Differentiate the ff/ Give Example.
1.if..then VS if...then....else statement VS if...then...else if
=>The
if-then
statement is the most basic of all the control flow statements. It tells your program to execute a certain section of code only if a particular test evaluates to true
.
Ex....
If TextBox1.Text = "Hello World!" Then 'Checks if "Hello World!" is written in the textbox.
ListBox1.Items.Add("Hello") 'If "Hello World!" is written then it enters "Hello" into the listbox.
End If 'Ends the If statement.
=>The if...then....else statement It tells your program to execute a certain section of code only if a particular test evaluates Must evaluate to True or False, or to a data type that is implicitly convertible to Boolean.
Ex....
If condition [ Then ]
[ statements ]
[ ElseIf elseifcondition [ Then ]
[ elseifstatements ] ]
[ Else
[ elsestatements ] ]
End If
' Single-line syntax:
If condition Then [ statements ] [ Else [ elsestatements ] ]
=> The If...Then...Else...if statement selection structure allows
the programmer to specify that a different action is to be performed when the
condition is True than when the condition is False.
Ex.....
If <condition > Then
statements
Else
statements
End If
statements
Else
statements
End If
e.g.: If average>50 Then
txtGrade.Text = "Pass"
Else
txtGrade.Text = "Fail"
End If
txtGrade.Text = "Pass"
Else
txtGrade.Text = "Fail"
End If
2. Object To Attribute To Behavior
=> An object is a software bundle of variables
and related methods. it Is Also objects are key to
understanding object-oriented technology.
You can look around you now and see many examples of real-world objects:
your dog, your desk, your television set, your bicycle.
=>An Attributes are a mechanism for adding metadata, such as compiler
instructions and other data about your data, methods, and classes, to
the program itself. Attributes are inserted into the metadata and are
visible through ILDasm and other metadata-reading tools. Attributes can
be used to identify or use the data at runtime execution using .NET
Reflection
=>The behavior to be exhibited by class instances at program run time is defined in methods. A method is a subroutine
(function) with a special property that it has access to data stored in
an object (instance) and is thereby able to control the state of the
object. (Note: Some languages allow direct access to instance variables (C++)). The various kinds of methods and language support for them differs. Kinds of methods include regular methods
that are created and called by programmer code and special methods
(constructors, destructors, conversion operators, static methods, e.g.)
that are created and called by compiler-generated code. A language may
allow the programmer to define, and even call, special methods.
3. Techniques in OOP
-Data Abstraction Vs Encapsulation
=>Data Abstraction is the process of recognizing
and focusing on important characteristics of a situation or object and
leaving/filtering out the un-wanted characteristics of that situation or
object.Lets take a person as example and see how that person is abstracted in various situations.
=>Encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class.
- Inheritance VS Polymorphism
=> Inheritance a suggests an object is able to inherit characteristics from another object. In more concrete terms, an object is able to pass on its state and behaviors to its children. For inheritance to work the objects need to have characteristics in common with each other.
=> Polymorphism n the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form. The word derives from the Greek "πολυμορφισμός" meaning "having multiple forms". In principle, polymorphism can however arise in other computing contexts and it shares important similarities to the concept of degeneracy in biology.
4. Class VS Method
=>Class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods enable a class object's behavior. Class instances are of the type of the associated class.
=>Methods is a subroutine (or procedure or function) associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time. Methods have the special property that at runtime, they have access to data stored in an instance of the class (or class instance or class object or object) they are associated with and are thereby able to control the state of the instance.The association between class and method is called binding. A method associated with a class is said to be bound to the class. Methods can be bound to a class at compile time (static binding) or to an object at runtime (dynamic binding).
5. ASP.Net Control
- Standard Control To Validation Control
=>Standard Control enables you to render standard element such as buttons, input filed like textbox,labels etc....
=> Validation Control enables you to validate form data before you submit the data to the server.
=>Encapsulation is an attribute of object design. It means that all of the object's data is contained and hidden in the object and access to it restricted to members of that class.
- Inheritance VS Polymorphism
=> Inheritance a suggests an object is able to inherit characteristics from another object. In more concrete terms, an object is able to pass on its state and behaviors to its children. For inheritance to work the objects need to have characteristics in common with each other.
=> Polymorphism n the context of object-oriented programming, is the ability to create a variable, a function, or an object that has more than one form. The word derives from the Greek "πολυμορφισμός" meaning "having multiple forms". In principle, polymorphism can however arise in other computing contexts and it shares important similarities to the concept of degeneracy in biology.
4. Class VS Method
=>Class is a construct that is used as a blueprint to create instances of itself – referred to as class instances, class objects, instance objects or simply objects. A class defines constituent members which enable these class instances to have state and behavior. Data field members (member variables or instance variables) enable a class object to maintain state. Other kinds of members, especially methods enable a class object's behavior. Class instances are of the type of the associated class.
=>Methods is a subroutine (or procedure or function) associated with a class. Methods define the behavior to be exhibited by instances of the associated class at program run time. Methods have the special property that at runtime, they have access to data stored in an instance of the class (or class instance or class object or object) they are associated with and are thereby able to control the state of the instance.The association between class and method is called binding. A method associated with a class is said to be bound to the class. Methods can be bound to a class at compile time (static binding) or to an object at runtime (dynamic binding).
5. ASP.Net Control
- Standard Control To Validation Control
=>Standard Control enables you to render standard element such as buttons, input filed like textbox,labels etc....
=> Validation Control enables you to validate form data before you submit the data to the server.
No comments:
Post a Comment