• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Methods

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 233
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 522
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The statement is correct, here is the code to support it.

[ January 20, 2004: Message edited by: Vicken Karaoghlanian ]
 
Beware the other head of science - it bites! Nibble on this message:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic