questions: /* 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) 2. Create a class cellphone with methods to print “ringing…”, “vibrating…”, etc. 3. Create a class Square with a method to initialize its side, calculating area, perimeter etc. 4. Create a class Rectangle & problem 3. 5. Create a class TommyVecetti for Rockstar Games capable of hitting (print hitting…), running, firing, etc. 6. Repeat problem 4 for a circle. */ answers package com.company; class Employee{ int salary; String name; public int getSalary(){ return salary; } public String getName(){ return name; } public void setName(String n){ name = n; } } class CellPhone{ public void ring(){ System.out.print
Comments
Post a Comment