Table of Contents

Lesson 3

Introduction to OOP

https://docs.google.com/spreadsheets/d/1K54FNn82SFvQxyFEzcR2T4OKEH1V5vZQldHqkn-fJLA/edit#gid=0

Objectives

Documentation

Java Oracle Tutorial - OOP Concepts
Principiile programarii orientate pe obiecte
Ciclul de viaţă al obiectelor

Exercises

Exercise 1

A class Robot contains:

Write a class which models the class Robot . Write a class TestRobot which test Robot class.

Exercise 2

A class called Circle contains:

Write a class which models the class Circle. Write a class TestCircle which test Circle class.

Exercise 3

A class called Author contains:

Write the Author class. Also write a test program called TestAuthor to test the constructor and public methods.

Exercise 4

A class called MyPoint, which models a 2D point with x and y coordinates contains:

Write the code for the class MyPoint. Also write a test class (called TestMyPoint) to test all the methods defined in the class.

Exercise 5

Modify Flower class from Ciclul de viaţă al obiectelor so that it keeps track of the number of constructed object. Add a method which returns the number of constructed objects. Use 'static' variables and methods for implementing this task.