Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading db.db file

 
Pallavi Mahajan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,
I'm trying to read db.db file.
I have writtena small program for that. I jsut want to know can I add few statements to the provided class functions for producing output or not? Because I'm adding println statements in toString() function. Is it valid to do that?
Thank you,
Pallavi
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Pallavi,
You really dont want to have System.out.println statements in a toString method. This is a standard method in all objects that other programmers expect to have work in a standard way.
Having said that - you can put debugging code anywhere you like before you hand in the assignment - just make sure you get rid of it before you hand it in. If you do something like:
System.out.println("DEBUG ...");
then you can do a search for the DEBUG string before you do your final compile, and get rid of anything like that.
Regards, Andrew
 
Pallavi Mahajan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew,
Thank you for the comments. I removed all the printf statement from my code ,also I can see the db.db contents on console. I am little confused here, do I need to store this output in data Stucture or text file or anything?
I have no idea how to proceed now?
Pallavi
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic