• 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

Having trouble getting string object into one array and then in to another

 
Ranch Hand
Posts: 43
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
this is part of a larger project but i figure if i can figure out this first step i can work the rest. I need to get a title from the user add it to a object array (i think thats what it is) and then when i call listAllItems(), items[] should be copied into a string array called listAllItems, and then printed, but currently im jusst having trouble i think making it an object and then make it an item in the items[], if i run case 3 the list it says null, whats going on any help would be so appreciated


 
Rancher
Posts: 3742
16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kip Bodey wrote:if i run case 3 the list it says null, whats going on any help would be so appreciated


On line 76 you create a new MediaItem instance and on line 78 you call its getTitle method, but you don't ever set a title for it, therefore it returns the default value for the title variable which is null.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic