Saturday 15 May 2010

java - how to make a condition for balance to print it -


This code is to print these objects to file named customer.txt . It's working correctly but I'm betting like Balance & gt; 3000 print that object.

How can I declare balance? Should I read the bytes for the rest and print it? file = a new file ("customer.txt"); Fiver V = New Firator (A); Buffed Vector B = New Baffed Vitter (V); Print Vitter P = new printrover (B); Human eman = new person ("Imaan", 5000); Mannour = new person ("Noor", 3500); Human Redah = New Person ("Redah", 0); Human Belief = New Person ("Imaan", 200); Human Mohamed Raid = new person ("Mohamedreda", 3000); Human Mohamed_Reda = new person ("Mohamed Reda", 2000); Human [] H = new person [6]; H [0] = belief; H [1] = male, `` h [2] = red; H [3] = believe; H [4] = Mohamed Raida; H [5] = Mohamed_Dardah; P.println (believe); P.println (noor); P.println (Redah); P.println (believe); P.println (MohamedREDA); P.println (Mohamed_Redah); P.flush (); }} Class Human {public string name; Public double balance; Public Human (String N, Double B) {this.balance = b; This.name = n; } @ Override public string to string () {return name + "" + remaining; }

Change your logic below:

array

 for  (int i = 0; i & lt; h long; i ++) {if (h [i]. Balance> 3000) {Pprint ln (h [i]) ; }}    

No comments:

Post a Comment