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 37 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 4 No

Post New Answer



More Visual Basic Interview Questions

___ is the control used to call a windows application.

0 Answers  


What does option Explicit means?

8 Answers   Infosys, IBM,


How would you attach pictures in column headers of List View Control?

0 Answers   RRB,


What is rdo in vb?

0 Answers  


What is meant by Establish Connection in RDO?

0 Answers  






What is MAPI ?

2 Answers  


What is the use of parameters collection?

2 Answers  


Where will we give the option explicit keyword and for what?

1 Answers  


how to create exe file using vb

9 Answers   Satyam,


___,___ arguments will be used to run a executable program in shell function

0 Answers  


What is the difference between modal and module-less window?

1 Answers  


To.set the command button for ESC ___ Property has to be changed.

0 Answers  






Categories