• 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

java help

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am stuck on this part where it does not write to an output file

the first class is contact I had to modify


this class oes the sorting this is fine



this is he class I need help with


 
Ranch Hand
Posts: 91
IntelliJ IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ismail,

Welcome to the Ranch.
 
Ismail Shaqiri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hey

Thank you
 
Vineeth Menon
Ranch Hand
Posts: 91
IntelliJ IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ismail,

I might be wrong Ismail, but I do not see you calling the printContacts method anywhere...
 
Ismail Shaqiri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry but what is that going to do? the sort is already done and when I run it is fine. The program works fine but it wont send it to the output file which is wired
I had it working but I changed something and it wont work now which is wired.
Thank you.
 
Vineeth Menon
Ranch Hand
Posts: 91
IntelliJ IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just after


mention if file is does not exist, create a new file in a if statement... something like this would do

if(!file.exist)
create a new file named p4output.txt
 
Ismail Shaqiri
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey VM,

Thank you so much for your help, I could not figure it out. I will submit the project the way it is. The Instructor will probably, take only a few points off. And I am curious to see what kind of dumb mistake I did.

Thank you.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, like Vineet said, your code doesn't call the printContacts method. And since it's the printContacts method which writes data to the file, that means that no data gets written to the file.
 
reply
    Bookmark Topic Watch Topic
  • New Topic