Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Mock Exam Errata
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
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Mock Exam Errata
Error again ( 4th time, same site ) Mr. Hareet! What will you say?
Arijit Daripa
Ranch Hand
Posts: 142
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Mr. Hareet!
One of the questions in
http://www.irixtech.com/java/scjp/mock-exam/practice-test-2
is
Identify the options that declare the return types for their respective method legally. a) public int getNumber( ) { return null; } b) public String[ ] getNameList( ) { return String[ ] { "Him", "Me", "She", "I" }; } c) public void foo( ) { return "I am from foo"; } d) public long getLength( ) { return 357.0; }
Your answer is (a) and (c).
(a)
Java
is allowing us to assign null to primitives!
(c) Returning from a method with return type
null
!
SCJP 5
Ashish Hareet
Ranch Hand
Posts: 375
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Modified option b to be correct option
public
String
[ ] getNameList( ) {
return new String[ ] { "Him", "Me", "She", "I" };
}
It's fun to be me, and still legal in 9 states! Wanna see my tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Error in a Mock Test
SCJP (now OCPJP) 1.6 Exam No. 1Z0-851, how to prepare?
IrixTech Mock Exam
Error again ( 3rd time, same site). Mr. Hareet! Come on!
Error again ( 2nd time, same site ). Mr Hareet! Where are you?
More...