

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


public static void main (String[] args) { mysteryPrint("Reverse"); MyInput.pause(); } static void mysteryPrint(String inString) { int n = inString.length()-1; if (inString.length()!=0)mysteryPrint(inString.substring(0,n)); for(int j=n; j>=0; j--) System.out.print(inString.charAt(j)); System.out.println(); }
public class Rectangle { protected int side1; //one side of the rectangle protected int side2; //the other side of the rectangle public Rectangle() { super(); } public Rectangle(int side1, int side2) { super(); this.side1 = side1; this.side2 = side2; } public int area() { return side1side2;} public int perimeter() { return 2(side1+side2); } public String toString() { return "[s1: " + side1 + " s2: " + side2 + "]"; } }
Double a = new Double(3.3); double b = 2.2; double c = a+b;