61932205-JAVA-TM-CLASSNOTES2 - ClassesandObjectsinJava...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Classes and Objects in Java Basics of Classes in Java
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 Contents Introduce to classes and objects in Java. Understand how some of the OO  concepts learnt so far are supported in  Java. Understand important features in Java  classes. 
Background image of page 2
3 Introduction Java is a true OO language and therefore the  underlying structure of all Java programs is classes. Anything we wish to represent in Java must be  encapsulated in a class that defines the “state” and  “behaviour” of the basic program components known as  objects. Classes create objects and objects use methods to  communicate between them. They provide a convenient  method for packaging a group of logically related data  items and functions that work on them. A class essentially serves as a template for an object  and behaves like a basic data type “int”. It is therefore  important to understand how the fields and methods are  defined in a class and how they are used to build a  Java program that incorporates the basic OO concepts  such as encapsulation, inheritance, and polymorphism.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4 Classes class   is a collection of  fields  (data) and  methods   (procedure or function) that  operate on that data.  Circle centre radius circumference() area()
Background image of page 4
5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 18

61932205-JAVA-TM-CLASSNOTES2 - ClassesandObjectsinJava...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online