Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within OCPJP
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
Ron McLeod
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
Sheriffs:
Paul Clapham
Rob Spoor
Junilu Lacar
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Piet Souris
Carey Brown
Bartenders:
Forum:
Programmer Certification (OCPJP)
Var args question...
John Brown
Greenhorn
Posts: 2
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
public class VarArgsTest{ public static void main(String... argv) { VarArgsTest test = new VarArgsTest(); test.method(1); test.method(new Integer(1)); test.method(1, 1, 1); test.method(new Integer(1), new Integer(2), new Integer(3)); } public void method(Integer... I) { System.out.println("Integer..."); } public void method(int... i) { System.out.println("int..."); } public void method(Integer I) { System.out.println("Integer"); } public void method(int i) { System.out.println("int"); } }
How many compilation errors in the following code?
a) No compilation error
b) 2
c) 4
[ January 12, 2007: Message edited by: John Brown ]
Deepak Bala
Bartender
Posts: 6663
5
I like...
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Should be easy to find out shouldnt it ?
SCJP 6 articles
-
SCJP 5/6 mock exams
-
More SCJP Mocks
John Brown
Greenhorn
Posts: 2
posted 16 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Easy with a compiler of course. This is not a mock exam question, I was just playing around with var args...
Why are var args ambiguous in the code sample?
[ January 12, 2007: Message edited by: John Brown ]
Don't get me started about those stupid
light bulbs
.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
what is int... refer to?
Var Arguments
overloading
Need Help
BETA: Method resolving, un/boxing varargs mock question
More...