• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Question on List

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This question is from Jxam.
You construct a List by calling
List(5,false)
which statements below are correct(assume that Layout managers do not modify the list properties).
a>The list supports multiple selection.
b>The list has 5 visible Items.
c>A vertical scrollbar is added automatically if needed.
d>The code fails to compile,the given constructor is not valid one.
My answers were b> & c>.
But the given answer is only b>
According to RHE, a list can have scrollbar as needed.
can anybody help on this please..
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right!,I even tried an example before posting reply.It automatically adds vertical scrollbar if needed.
Any correction.
Thanks.
Prem
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, I found the similar Question in simon roberts where it has given the anwser choice vertical is added as needed is also right.(Ex:if added items are more then 5).
Good Luck.
Vijay
 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Read the question again. All that the question says is that alist is constructed with 5 items set visible and multi selection not enabled. The question did not mention adding items more than 5. So, for the given List constructor parameters and no other details, only answer b is correct. By the way, I got is wrong to, as I selected b & c.
 
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic