File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "overriding methods" Watch "overriding methods" New topic

overriding methods

Ireneusz Kordal
Ranch Hand

Joined: Jun 21, 2008
Posts: 423
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

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: 802

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. 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:
subject: overriding methods
It's not a secret anymore!