Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search Coderanch
Advance search
Google search
Register / Login
Sandra Dakurah
Greenhorn
+ Follow
2
Posts
2
Threads
0
Cows
since Dec 01, 2004
Merit badge:
grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
Ranch Hand Scavenger Hunt
Number Posts (2/100)
Number Threads Started (2/100)
Number Cows Received (0/5)
Number Likes Received (0/10)
Number Likes Granted (0/20)
Set bumper stickers in profile (0/3)
Report a post to the moderators (0/1)
Edit a wiki page (0/1)
Create a post with an image (0/2)
Greenhorn Scavenger Hunt
First Post
Number Posts (2/10)
Number Threads Started (2/10)
Number Likes Received (0/3)
Number Likes Granted (0/3)
Set bumper stickers in profile (0/1)
Set signature in profile
Search for a post/thread (0/3)
Set a watch on a thread
Save thread as a bookmark
Create a post with an image (0/1)
Recent posts by Sandra Dakurah
inheritance
To my suprprise the code below gives as a result
5, sub.
Does anybody know he rule behind this?
class Super { int index = 5; public void printVal() { System.out.println( "Super" ); } } class Sub extends Super { int index = 2; public void printVal() { System.out.println( "Sub" ); } } public class Runner { public static void main( String argv[] ) { Super sup = new Sub(); System.out.print( sup.index + "," ); sup.printVal(); } }
[JAM -- Edited to include [CODE] and [/CODE] tags]
[ December 10, 2004: Message edited by: Joel McNary ]
show more
19 years ago
Beginning Java
Why is main not a key word?
Hi everybody,
I just started studying for the java 2 programmers exam. Can anybody tell me why main is not a key word? Can I use main for any variable or function name? (I hope not).
Sandra
show more
19 years ago
Programmer Certification (OCPJP)