You are on page 1of 1

StringTokenizer

import java.util.StringTokenizer;
class staffApp {
public static void main(String args[]) {
Scanner inp = new Scanner(System.in);
int go = 1, bil = 0;

while(go==1) {
System.out.print("\nEnter[staffID;staffName;staffDp
mt;staffPhoneNo;staffIncome]");
String data = inp.next();

StringTokenizer token = new


StringTokenizer(data,";");
String staffID = token.nextToken();
String staffName = token.nextToken();
String staffDpmt = token.nextToken();
String staffPhoneNo = token.nextToken();
String staffIncome = token.nextToken();
double sI =
Double.parseDouble(staffIncome);

if(income > 5000)


bil++;

System.out.println("Stop = 0, Continue =
Otherwise");
go = inp.nextInt();
}

System.out.println("…" + bil);
}
}

class Staff{
private String name;
private String dpmt;
private int totYears;
// all necessary methods
}

You might also like