Tester Example

Beschreibung

Example code of java class tester
joannazhang13
Notiz von joannazhang13, aktualisiert more than 1 year ago
joannazhang13
Erstellt von joannazhang13 vor mehr als 9 Jahre
12
0

Zusammenfassung der Ressource

Seite 1

public class Tester{public static void main (String [] args){Shape circ= new Circle(10, "circle");Shape sq= new Square(9.4, "square");Square rectangle1= new Rectangle (10, 5, "rectangle);Rectangle rectangle2= new Rectangle(10, 5, "rectangle);System.out.println("The area of " +circ.getName()+ " is: " + circ.getArea());if (rectangle1.compareTo(rectangle2)==0){System.out.println("The two rectangles are the same size");}else{System.out.println("The two rectangles are not the same size");}System.out.println("The perimeter of" + sq.getName()+ " is: "+ sq.getArea());}}

Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Java Week 5 Object Oriented Programming
Troy Bowlin
What is an interface?
joannazhang13
Interface Example
joannazhang13
Java Practice 1
Ummm No
Java Practice 2
Ummm No
Servion - Java Questionnaire
rohit.benedict
Java Core. Basics
Gadget
Programming Review
Shannon Anderson-Rush
Useful String Methods
Shannon Anderson-Rush
Programming in Java
Faheem Ahmed
Object Oriented Programming Concepts
Cmagapu