File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Default Constructor

 
Roger Zhao
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,all:
Given:
1. public class Test { }
What is the prototype of the default constructor?
A. Test()
B. Test(void)
C. public Test()
D. public Test(void)
E. public void Test()
Which is correct one, A or C?
As I known, default constructor is with the same identifier as the class. So I choose C. Right?
Thanks,
Roger
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I known, default constructor is with the same identifier as the class. So I choose C. Right?
yup.. If you had:
class Test { }
then the answer would've been A
[ September 02, 2003: Message edited by: Andres Gonzalez ]
 
K Ville
Ranch Hand
Posts: 58
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Same here. The default constructor(the one the compiler provides) takes the same identifier as the class'. So, C. public Test(){} is the correct answer. This very knowledge I got from Madame Sierra's book. I'm targetting Oct. 18 as my exam date. God bless!
 
Roger Zhao
Ranch Hand
Posts: 73
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks.
V,my Exam is coming this week. God bless you and me!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic