This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes overriding methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "overriding methods" Watch "overriding methods" New topic
Author

overriding methods

Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
Hi,
could someone explain me why this code works?
Compiler gives me warning 'go(int[]) in B cannot override go(int...) in A'
but .... it compiles and prints: 12

Vidya Singh
Greenhorn

Joined: Mar 21, 2007
Posts: 28
It does not give any warning to me while compiling.
Ninad Kulkarni
Ranch Hand

Joined: Aug 31, 2007
Posts: 787

compiles fine and output 12


SCJP 5.0 - JavaRanch FAQ - Java Beginners FAQ - SCJP FAQ - SCJP Mock Tests - Tutorial - JavaSE7 - JavaEE6 -Generics FAQ - JLS - JVM Spec - Java FAQs - Smart Questions
Kishore Kumar
Ranch Hand

Joined: Oct 15, 2007
Posts: 71
I am also getting the warning message during compiling and the output is also 12.
I am using java 1.5 version.

Main.java:7: warning: go(int[]) in
method is missing '...'
public int go(int [] d){
^
1 warning


Can any one tell me why i am getting this warning message.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: overriding methods