• Post Reply Bookmark Topic Watch Topic
  • New Topic

Methods  RSS feed

 
Vineela Devi
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When i was going through the language fundamentals i came across the statement "a method can declare a return type without having a return statement in its body ".
can anyone please explain this with an example justifying the above statement?
Thanks in Advance
 
Ram Mohan
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, i guess it could refer to the "void" return method which returns nothing, but technically falls under the "category of a return type which is nothing"
hope u get what i'm trying to say....anyways, if u could let me know the name / page of the book or give me a link to that particular article, i could help better
 
Gabriel White
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was a JAVA for beginners course I wouldn't think that they were speaking of a mutator in this case. I am interested to know about the text or the html page that you are refering to as well.
Thanks
Steve
 
Vicken Karaoghlanian
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The statement is correct, here is the code to support it.

[ January 20, 2004: Message edited by: Vicken Karaoghlanian ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!