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)
Method calls in declaration
Priya Rajan
Greenhorn
Posts: 27
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
public class AQuestio
{
private int i = giveMeJ();
private int j = 10;
private int giveMeJ()
{
return j;
}
public static void main(
String
args[])
{
System.out.println((new AQuestio()).i);
}
}
output is 0. why?
Pl explain.
Thanks
Junilu Lacar
Sheriff
Posts: 17644
300
I like...
posted 22 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
This question has been asked many times before. Do a search on "givemej".
I yam what I yam and that's all that I yam - the great philosopher Popeye. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Explain this?
Variable initialization
please explain why the compiler is not complaining and why the output is 0
forward refrerences
instance variable
More...