Solved

What's the return type !

Posted on 2008-10-09
6
154 Views
Last Modified: 2013-11-23
Hi

Now that I know void doesn't return anything what about this code.

What's the return type in this code?
public boolean rentHouse(String address, double weeklyRent, House rentedHouse)

Open in new window

0
Comment
Question by:bt1942
  • 4
  • 2
6 Comments
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22683443
Refer to this again: http://java.sun.com/docs/books/tutorial/java/javaOO/methods.html

You tell me what the return datatype is.  Since you understand void from last question, should be able to pick it out from above.
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22683450
{not trying to be funny by the way, trying to ensure you learn the concept of where and what the return type is in a method signature so you will be able to recognize when someone changes method signature on you}
0
 

Author Comment

by:bt1942
ID: 22683491
mwvisa1 // hi, is it boolean?
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 59

Accepted Solution

by:
Kevin Cross earned 500 total points
ID: 22683508
yes. exactly right.

modifier returntype methodname(parameters, ...) {
    // code
}

0
 

Author Closing Comment

by:bt1942
ID: 31504885
Thanks for the comment!
0
 
LVL 59

Expert Comment

by:Kevin Cross
ID: 22683543
No problem.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question