- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 2
- Posts with Upvotes
- 1
- Upvoting Members
- 2
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: **setLength** is method, use parentheses() for input values /* rect1.setLength = 4.0; rect1.setWidth = 5.0; */ rect1.setLength( 4.0); rect1.setWidth( 5.0); getters shouldn't return void type // public void getLength() { public double getLength() { return length; } // public void getWidth() { public double getWidth() { return width; } | |
Re: public void setHour(int newHour) { //this.setHour = setHour; this.newHour = newHour; } public void display() { //System.out.println(int newHour + int newMinutes + int newSeconds); System.out.println( newHour +":"+ newMinutes +":"+ newSeconds); } // added public String showTime() { System.out.println("hh:" + "mm:" + "ss"); return ""; // added } | |
Re: class Program { public static void main(String[] args) throws InterruptedException { //Scanner rr = read Scanner(System.in); Scanner rr = new Scanner(System.in); System.out.println( "Do you want to search for a book?: "); String N = rr.next(); String y = "yes"; String n = "no"; // if(n.equalsIgnoreCase("No")) { if (N.equalsIgnoreCase(n)) { System.out.println("Thank … |