• 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

Console input menue unresponsive on recall

 
Ranch Hand
Posts: 51
1
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

as part of the O'Reilly School Java 3 course I am currently tackling homework for a small I/O-program with console input.

Right now, only the part when you enter "E" or "e" on the console is implemented and the issue I am trying to tackle is described in the comment starting at line 38:



and the other class which is referenced:



Any hint on how to solve this issue with the unresponsive input would be highly appreciated :-)

 
Saloon Keeper
Posts: 10732
86
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see where you call EnterOnTheConsole(), which should begin with a lower case. Use ArrayList<String> and not Vector<String>.
 
Marcus Rauchfuss
Ranch Hand
Posts: 51
1
Eclipse IDE Python Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Uuups, sorry about this, here's the corrected version (I prefer working with vector, for some reason)

enterOnTheConsole() is inserted on line 105 :-)

 
Carey Brown
Saloon Keeper
Posts: 10732
86
Eclipse IDE Firefox Browser MySQL Database VI Editor Java Windows ChatGPT
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think your call to enterOnTheConsole() is giving you grief. Comment out line 105. Also, your call to anInputString.charAt(0) will throw an exception if you press enter (ie a blank line). Put a loop around all the lines in your main() with a test for a 'Q' that will break out of the loop. Your scanner member variable is never used because you never create an instance of your StringFileWriter class.

Vector predates ArrayList but has not been deprecated because it serves a very narrow function, specifically multi-threaded access to the same list instance. Otherwise, use ArrayList.
 
If you try to please everybody, your progress is limited by the noisiest fool. And this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic