Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Struts
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:
Struts
confusion in vaiable initialization concept
Ansar Shah
Greenhorn
Posts: 29
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello All!
public abstract class A { int a = 8; public A() { show(); } abstract void show(); } public class Trick extends A{ int a = 90; void show(){ System.out.println( "value of a is " + a); } public static void main(String args[]){ new Trick(); } }
The out put of the main() method is "value of a is 0". Please explain the flow. It is a bit confusing for me.
Thanks
Ansar Shah
Ansar Shah
Greenhorn
Posts: 29
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Sorry for the inconvinience!
I wanted to post in ceritfications forum.
Regards
Ansar Shah
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
can somebody explain me the difference between
Abstract Inner Class
confusion in variable initialization concepts
help me in kicking off the bug from the following code
compile-time errror
More...