Tester Example

Descrição

Example code of java class tester
joannazhang13
Notas por joannazhang13, atualizado more than 1 year ago
joannazhang13
Criado por joannazhang13 mais de 9 anos atrás
15
0

Resumo de 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());}}

Semelhante

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