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
Win a copy of
Helidon Revealed: A Practical Guide to Oracle’s Microservices Framework
this week in the
Java in General
forum!
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
Liutauras Vilda
Ron McLeod
Sheriffs:
Jeanne Boyarsky
Devaka Cooray
Paul Clapham
Saloon Keepers:
Scott Selikoff
Tim Holloway
Piet Souris
Mikalai Zaikin
Frits Walraven
Bartenders:
Stephan van Hulst
Carey Brown
Forum:
Programmer Certification (OCPJP)
overloaded??
srikanth reddy
Ranch Hand
Posts: 252
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Given the following class definition, which of the following methods could be legally placed after the comment //Here public class Rid{ public void amethod(int i, String s){} //Here } 1)public void amethod(String s, int i){} 2)public int amethod(int i, String s){} 3)public void amethod(int i, String mystring){} 4) public void Amethod(int i, String s) {}
answer 1 and 4..
how come 4..
might be i didnt get the question correctly!!
can anyone explain please..
thanks
sri
Thanks & Regards<br /> <br />-Srikanth
premraj cheguri
Greenhorn
Posts: 21
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
1 is correct because it is overloading the given method.
4 is correct because it is a new method.
adding 2 will result in compilation error, bcoz we are just chaning the return type with same method signature.
3 is nothing but the same method
srikanth reddy
Ranch Hand
Posts: 252
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
yah ..i overlooked it .. thanks
Thanks & Regards<br /> <br />-Srikanth
premraj cheguri
Greenhorn
Posts: 21
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Srikanth r u from Hyderabad. mail me at
[email protected]
. when r u planing to go for
scjp
exam. im planing to go for
java
5.0 n how abt u?
srikanth reddy
Ranch Hand
Posts: 252
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
yes prem iam from hyd...willing to give soon.....iam confused that on the net there are so many mocks i have seen that contain awt and io packages...i followed the syllabus accor to KnB...so frnds are listeners and datastreams are present.....
thanks
sri
Thanks & Regards<br /> <br />-Srikanth
A Kumar
Ranch Hand
Posts: 982
posted 19 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hi,
For SCJP 1.4 ...there arent AWT and IO....
Have a look here...
http://www.sun.com/training/catalog/courses/CX-310-035.xml
For SCJP 1.5...
we have IO...
(Check in section 3)
http://www.sun.com/training/catalog/courses/CX-310-055.xml
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Marcus Green - Qn : 23 - Doubt
overloaded methods
Overloading
Overload
Overloaded methods
More...