wood burning stoves*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Some confusing ones part 3 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 "Some confusing ones part 3" Watch "Some confusing ones part 3" New topic
Author

Some confusing ones part 3

Gaurav Chikara
Ranch Hand

Joined: Jun 09, 2000
Posts: 410
Question 50: What does the following line of code do? TextField tf = new TextField(30);
Select the one right answer.
a.This code is illegal; there is no such constructor for TextField.
b.Creates a TextField object that can hold 30 rows, but since it is not initialized to anything, it will always be empty.
c.Creates a TextField object that can hold 30 columns, but since it is not initialized to anything, it will always be empty.
d.This code creates a TextField object that can hold 30 rows of text.
e.Creates a new TextField object that is 30 columns of text
coorect answer is e but i would rate c as the correct answer
your expert views please


SCJP,SCWCD,SCBCD<br />If Opportunity doesn't knock then build the door
jafarali
Ranch Hand

Joined: Jul 15, 2000
Posts: 37

It will not be always empty
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
I think answer (c) goes overboard with the use of 'always' qualifier. Once some text is assigned to the textfield, it will have some text in it.
(c) is quite misleading, but e is the right answer.
Ajith

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
 
Don't get me started about those stupid light bulbs.
 
subject: Some confusing ones part 3