Friday, August 20, 2010

How to connect in a bluej program a stock file and a purchase file?

It is a project i have made so i have to connect the code to add stock details with the purchase code i have made. So how do i do that. Its urgent plz help!!!??????How to connect in a bluej program a stock file and a purchase file?
I don't understand what you mean by the files you have made.





If you have made a stock and purchase class, then you create new instances of these classes (probably in a new class with a main method). Then you call the methods on these classes as you need.





For instance, you have a stock class that has an *** method.





Stock st = new Stock();


stock.add( %26lt;parameters%26gt; );





Similarly with the purchase class, create an instance of the class and call the methods on it.





If you are talking about inputting a text file you could use a Scanner and the file name as the parameter to the scanner.


The Scanner API:


http://java.sun.com/javase/6/docs/api/ja鈥?/a>


To output a file, you need to use output streams, etc.


I answered a previous question on output of files, check it out here (options 2 and 3):


http://answers.yahoo.com/question/index;鈥?/a>
  • long hair styles
  • Fish
  • No comments:

    Post a Comment