class

32
an Abhyaas Edu Corp initiativ Finishing School OBJECTS AND CLASSES

Upload: raghu84taduri

Post on 17-Dec-2015

1 views

Category:

Documents


0 download

DESCRIPTION

java programming

TRANSCRIPT

Slide 1

OBJECTS AND CLASSES

an Abhyaas Edu Corp initiativeFinishing SchoolTo describe objects and classes, and use classes to model objects To demonstrate how to define classes and create objectsDefining instance variables in a classDefining methods with arguments and return types.Defining constructors in as class.Using this keyword .Garbage Collection.

Finishing Schoolan Abhyaas Edu Corp initiativeOOPS ConceptsClass A blueprint that defines the attributes and methods.Object An instance of a Class.AbstractionHide certain details and show only essential details.Encapsulation Binding data and methods together.Inheritance Inherit the features of the superclass.Polymorphism One name having many forms.Dynamic Binding linking of the function call to the code to be substituted at run time.Message PassingObject will communicate withgeach other by passing messages.

Finishing Schoolan Abhyaas Edu Corp initiativeClass & ObjectA class is a description of an object -an instance of a class. An object consists of attributes and behavior, everything is an object, and every object is a member of a class.The data components of a class are often referred to as the instance variables of that class.Objects have attributes and methods associated with them, and every object that is an instance of a class is assumed to possess the same methods.Java is strictly an objected-oriented programming language. All the Java code that you write will appear in either a class or an interface.

Finishing Schoolan Abhyaas Edu Corp initiativeBlueprint analogyiPod blueprintstate: current song volume battery lifebehavior: power on/off change station/song change volume choose random songiPod #1state: song = KALHO NA HO volume = 17 battery life = 2.5 hrsbehavior: power on/off change station/song change volume choose random songiPod #2state: song = yaarian" volume = 9 battery life = 3.41 hrsbehavior: power on/off change station/song change volume choose random songiPod #3state: song = Tum hi ho" volume = 24 battery life = 1.8 hrsbehavior: power on/off change station/song change volume choose random songcreates

Finishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiativeFinishing Schoolan Abhyaas Edu Corp initiative