What is the difference between a property a method and an
event? Give an example of each.




Answers were Sorted based on User's Feedback



What is the difference between a property a method and an event? Give an example of each...

Answer / pratap557

Property are a type of method that shows state of an Object
like Caption, backcolour etc.
Methods/Functions are for changing Or doing something on
the Object Like Move,Remove, Add etc.

Event are Objects which means that something happend for
which the object must respond to. And for this very reason
we write method like
button1_Click( sender Object, event Object)
The event Object(Delegate) is related with the method of
that responder Object(Button)

Is This Answer Correct ?    174 Yes 30 No

What is the difference between a property a method and an event? Give an example of each...

Answer / gaurav

Object has three characteristics
and these are
1.Property
2.Method
3.Event

Property represents (data) characteristic of an object..

Method represents the behavior(action)performed by an object..

Event is msg sent by an object to signal an activity


Example:-

For a class Employee
FirstName,LastName,Salary <------ Properties
Hire,Promote <------ Methods
On hire, On promote <------ Events

Is This Answer Correct ?    90 Yes 8 No

What is the difference between a property a method and an event? Give an example of each...

Answer / amir

A property indicates the state of object. Eg. Visible =
True.

A method is a used for changing the state of object.

An event is a feedback of object state change. An event is
triggered when the object state is changed.

Is This Answer Correct ?    82 Yes 36 No




What is the difference between a property a method and an event? Give an example of each...

Answer / ashwini khopkar

Property:-
1) It tells something abt an object, such as its
name,color,size,location,or how it'll behave.
2) We can thing property as adjectives that describe
objects.
3) For e.g., Caption property of a form are called as
Form1.caption.
Method:-
1) Actions associated wid objects are called as method.
2) Methods are verb.
3) Some typical methods are move, print, resize & clear.
Event:-
1) Code related 2 some objects.
2) It is also verb.
3) It is an action that may b taken by d usr, such as
click, drag, key press, or scroll.

Is This Answer Correct ?    30 Yes 10 No

What is the difference between a property a method and an event? Give an example of each...

Answer / manish mehta

Object has three characteristics
and these are
1.Property
2.Method
3.Event

Property represents (data) characteristic of an object..

Method represents the behavior(action)performed by an object..

Event is msg sent by an object to signal an activity


Example:-

For a class Employee
FirstName,LastName,Salary <------ Properties
Hire,Promote <------ Methods
On hire, On promote <------ Events

Is This Answer Correct ?    24 Yes 6 No

What is the difference between a property a method and an event? Give an example of each...

Answer / kunal yagnik

Methods and properties basically both are functions defining
different states if we relate them to real world.Both are
defined in a class and the procedure to execute them is a
bit different but this is only done to make the code more
transparent and visible.To understand this look the example
below :
He can walk,talk,run,write are methods while He is
sweet,soft spoken,fair are properties.
We will get the closer look if we try to implement these on
working code.

Is This Answer Correct ?    30 Yes 21 No

What is the difference between a property a method and an event? Give an example of each...

Answer / kunal yagnik

while an event always happens with respect to time eg: when
this button clicked then the box will display this click
happens with respect to time so this is event (a button click)

Is This Answer Correct ?    19 Yes 13 No

What is the difference between a property a method and an event? Give an example of each...

Answer / nitesh

when you will click on radio button below (e. g. yes ) that
will generate an event. when the respected ouput will be
generated (i. e. incrementing no. of yes), that is caused by
the method. And the color (i.e. Green / red) of radio button
is set due to use of property.

....Nitesh Singh

Is This Answer Correct ?    7 Yes 1 No

What is the difference between a property a method and an event? Give an example of each...

Answer / chris barry

There is very little difference between VBA methods and
properties. A property is not analagous to a Java field, it
executes a class procedure just as a method does. The main
difference is that a property can be the left side of an
assignment.
Class methods are defined using the Function and Sub
keywords just as they would be used outside a class. User
defined properties use the Property key word together with
Get, Set or Let. A "Property Get" procedure seems almost
indistinguishable from a "Function" except that if there is
a corresponding "Property Let" then the compiler may check
that the type returned by "Get" is the same as the type
accepted by Let.
A "Property Let" procedure is defined as a normal function
with at least one argument, but it is called with one
argument fewer. The final argument takes its value from the
right side of the assignment. e.g.

Dim arr(4) As Integer
Property Let element(idx, val)
arr(idx) = val
End Property

could be called as:

ClassName.element(1) = 2

An event is something that happens asynchronously to the
main thread of the application, which can be linked to a
user-defined procedure (an event handler) which will be
invoked when the event occurs. In VBA at least, events are
most commonly generated by controls responding to user
actions.

Is This Answer Correct ?    4 Yes 1 No

What is the difference between a property a method and an event? Give an example of each...

Answer / sk sultan ahmad

A Property is a way to expose an internal data element of a class in a simple manner.
Method is a block of code that contain a series of statement.
Event are programming construct use to pass notification back from one class.

Is This Answer Correct ?    5 Yes 3 No

Post New Answer



More Visual Basic Interview Questions

How would you create properties in ActiveX Control?

0 Answers  


How would you create Visual basic Document file?

0 Answers  


Specify technical & functional architecture of your last 2 projects.

0 Answers  


How would you add column headers in listview control?

0 Answers  


Why doesn't "my string" & Chr$(13) do what I want?

0 Answers  






___ VB constant make the menu item in centre.

0 Answers  


what is the difference between procedures,attributes and functions?

1 Answers   Microsoft, Patni,


What two methods are called from the ObjectContext object to inform MTS that the transaction was successful or unsuccessful?

1 Answers  


How would you navigate between one document to another document

0 Answers  


What is the return type of Instr and Strcmp?

3 Answers  


Types of LockEdits in RDO.

0 Answers  


How to find the current record position in data control?

0 Answers  






Categories