Skip to content

Latest commit

 

History

History

39.Chapter_8_Practice_Set

Java Tutorial: Basic Questions on Object Oriented Programming

  1. Create a class Employee with the following properties and methods:
  • Salary (property) (int)
  • getSalary (method returning int)
  • name (property) (String)
  • getName (method returning String)
  • setName (method changing name)
  1. Create a class cellphone with methods to print “ringing…”, “vibrating…”, etc.
  2. Create a class Square with a method to initialize its side, calculating area, perimeter etc.
  3. Create a class Rectangle & problem 3.
  4. Create a class TommyVecetti for Rockstar Games capable of hitting (print hitting…), running, firing, etc.
  5. Repeat problem 4 for a circle.

Handwritten Notes: Click to Download

Ultimate Java Cheatsheet: Click To Download