Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
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
Tim Cooke
paul wheaton
Ron McLeod
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Saloon Keepers:
Tim Holloway
Roland Mueller
Bartenders:
Forum:
Java in General
Troubling with this code
Vimal Kumar Venugopal
Ranch Hand
Posts: 43
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
package packA;
public class Beverage {
public static void main(
String
[] args) {
System.out.println("hi");
}
}
----------------------------------------------------
package packB;
import packA.Beverage;
class Tea extends Beverage {
}
--------------------------------------
and when i run Tea class..
I get the output as"hi"!!!
How does this happen??
"Value has a Value only if its value is valued!"
Randall Twede
Ranch Hand
Posts: 4716
9
I like...
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
when you extend a class you inherit all its members. i guess that includes main()
SCJP
Visit my
download page
Campbell Ritchie
Marshal
Posts: 80982
530
posted 13 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
. . . and welcome to the Ranch
I want my playground back. Here, I'll give you this tiny ad for it:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Question on Packages from Kathy Sierra Book
import vs extend?
what happens at runtime?
K&B: :Page 14 Default Access - misleading sentence
packages from KB
More...