Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
Search Coderanch
Advance search
Google search
Register / Login
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Programmer Certification (OCPJP)
return value
Anonymous
Ranch Hand
Posts: 18944
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
For few methods which declares a return value , even if the
return value is not specified,program compiles and run
assuming as return 0.Actually, shouldnt it give compile
error "return value required".I hope i am clear.
chetan nain
Ranch Hand
Posts: 159
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
in void methods, we may declare
return ;
however,
return <expression>;
will not be allowed in void methods.
refer khalid pg 148 Table 5.1
chetan nain
Ranch Hand
Posts: 159
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
oops, sorry about that typo above.
return expression; will not be allowed in void methods
With a little knowledge, a
cast iron skillet
is non-stick and lasts a lifetime.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Java Pass by value? But List objects change!
array and setmethod
exception..try catch block execution
Equals method.
pass parameter from jsp to jsp
More...