Results 1 to 2 of 2
  1. #1
    chkm8 is offline Member
    Join Date
    Dec 2008
    Canjulao, Jagna, Bohol Philippines
    Rep Power

    Default help array set null or delete

    hai.., I have problem of setting the array found to null. I want to set the found array(result of the search of the item to be stock out) to null if the number of stock to out is equal to the number of the stocks in of the product.


    Chocolate 001 $5.50 12(stocks in)

    Enter Number of stock out: 12

    Number of stock out: 12
    total cost=(12*5.50)

    //so the Chocolate now will be out of stock and I want to delete it so that the user can input another product

    heres my code.

    Java Code:
    public ProductInfo computeStockOut() //computing the total amount of stock
    		int num;
    		double totalAmount;
    		int newStck;
    		System.out.print("Enter Number Of Stock to Out: ");
    				System.out.println("Total Amount is: "+totalAmount);
    				System.out.println("You Enter Number greater than your stock products");
    		return found;	

  2. #2
    xcallmejudasx's Avatar
    xcallmejudasx is offline Senior Member
    Join Date
    Oct 2008
    Houston, TX & Flint, MI
    Rep Power


    stockIn = stockIn - stockPurchased.

    Maybe I'm not following your question properly but I think you can just do that. I think your issue is with newStck. Why not just this.setNumStock(getNumStock - num) or something along those lines.

    What is happening when you run it? Does numstock remain at 12 or is it throwing an error?
    Liberty has never come from the government.
    Liberty has always come from the subjects of government.
    The history of liberty is the history of resistance.
    The history of liberty is a history of the limitation of governmental power, not the increase of it.

Similar Threads

  1. Delete Button
    By Zoroxeus in forum JavaServer Faces (JSF)
    Replies: 3
    Last Post: 10-26-2008, 03:45 PM
  2. Delete
    By Sarinam in forum New To Java
    Replies: 6
    Last Post: 07-23-2008, 12:09 PM
  3. Delete From .txt file
    By Sarinam in forum New To Java
    Replies: 86
    Last Post: 06-28-2008, 11:17 AM
  4. Listbox Add/Delete
    By Rageagainst20 in forum New To Java
    Replies: 2
    Last Post: 04-16-2008, 05:49 PM
  5. Null array when passed to MouseListener
    By stevemcc in forum New To Java
    Replies: 2
    Last Post: 04-02-2008, 11:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts