• 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

Some confusing ones part 3

 
Ranch Hand
Posts: 413
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

It will not be always empty
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic