100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
Object Oriented Programming R51,00   Add to cart

Class notes

Object Oriented Programming

 7 views  0 purchase

A class is therefore set of attributes put together in one container or capsule. This process of putting together attributes and methods (behavior) is called Encapsulation.

Preview 1 out of 4  pages

  • June 16, 2021
  • 4
  • 2020/2021
  • Class notes
  • Dr simba
  • All classes
book image

Book Title:

Author(s):

  • Edition:
  • ISBN:
  • Edition:
All documents for this subject (7)
avatar-seller
keanuperumal
CSI21M1 Java Programming Notes, prepared by Mr. S. Nyika, Semester I, 2019


Lecture 1: Object Oriented Programming

Objectives:
At the end of this lecture, students will be able to:
• explain the important principles of Object Oriented Programming
• define the term class
• define the term object
• explain the relationship between a class and its objects
• understand that there are two kinds of programmers
• explain why class programmers need to hide data
• advantages of Object Oriented Programming as opposed to linear programming
• Write a class in java syntax
Notes:

A class in Java is the same as a class in C++. It has attributes and behaviour which are put together as
one unit. This unit is called a class. A class is therefore set of attributes put together in one container or
capsule. This process of putting together attributes and methods (behaviour) is called Encapsulation.

An example is the car. When this is taken as a class will therefore appear with attributes and methods or
functions. There are three principles which are used to make sure the class is well formed. These are
Encapsulation, Polymorphism and Inheritance. Encapsulation is the bundling together the attributes
and the methods as follows:

class Car
{
String carModel;
int engineNumber;
int yearManufatured;
void setCarModel(String model)
{
carModel=mode;
}
void setEngineNumber(int enumber)
{
engineNumber=enumber;
}
void setYearManufactured(int year)
{
yearManufatured=year;
}
String getCarModel()
{
return carModel;
}
int getEngineNumber()
{
return engineNumber;
}
int getYearManufactured()
{
return yearManufatured;
}
}


Page 1 of 4

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through EFT, credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying this summary from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller keanuperumal. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy this summary for R51,00. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

73216 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy summaries for 14 years now

Start selling
R51,00
  • (0)
  Buy now