Intro to Java Web-Notes_Part83

Intro to Java Web-Notes_Part83 - public Problem 4...

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

View Full Document Right Arrow Icon
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: public Problem 4 this.weight = numPassengers = weight; 1; int maxSpeed() return 45; String report() return "Bicycle with weight of String identifyOwner<int year) if (year > 1983) return "Bill Gates"; else return "Henry Ford"; void setMaxValue<double value) System.out.println("MaX value is: Find the problem(s) With the following code: public interface Financial { public public public } double getCost(); String identifyOwner<int year); void setMaXValue<double value); public class MyProgramZ { public { } abstract class { public static void main (String [1 Bicycle b = new Bicycle(40); System.out.println(b.report()); b.numPassengers = 25; Transport implements Financial int numPassengers = O; abstract public int maxSpeed(); public { } } double getCost() return 1.00; class Bicycle extends Transport { public public { } public int weight; Bicycle(int weight) this.weight = numPassengers = weight; 1; int maxSpeed() // " + weight + "pounds"; " + value); args) // // // // { return 45; } public String report() { return "Bicycle with weight of " + weight + "pounds"; } public String identifyOwner(int year) { if (year > 1983) return "Bill Gates"; else return "Henry Ford"; } public void setMaXValue(double value, int X, int y, int 2, int a, int b, int c) { System.out.println("Max value is: " + value); } Problem 5 Find the problem(s) with the following code: public interface Financial { public double getCost(); public String identifyOwner(int year); public void setMaxValue(double value); } public class MyProgramZ { public static void main (String args) { Bicycle b = new Bicycle(40); System.out.println(b.report()); b.numPassengers = 25; // } abstract class Transport implements Financial l private int numPassengers = O; // abstract public int maxSpeed(); public double getCost() { return 1.00; } public void setMaXValue(double value) { System.out.println("Max value is: " + value); } } class Bicycle extends Transport { public int weight; // public Bicycle(int weight) l this.weight 2 weight; numPassengers = l; // } public int maxSpeed() ...
View Full Document

Page1 / 2

Intro to Java Web-Notes_Part83 - public Problem 4...

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

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