Tester Example

Descripción

Example code of java class tester
joannazhang13
Apunte por joannazhang13, actualizado hace más de 1 año
joannazhang13
Creado por joannazhang13 hace más de 9 años
12
0

Resumen del Recurso

Página 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());}}

Mostrar resumen completo Ocultar resumen completo

Similar

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