Anil Philip
Posts: 19
Nickname: anilphilip
Registered: Nov, 2002
|
|
Re: Problem with Sending and getting to a class
|
Posted: Nov 21, 2002 6:59 AM
|
|
where is byearValue declared? I hope it is not shadowed by another variable with the same name?
> OPps hit post by accident. > > here is the block of code > > //Get Birth Year > String byear = JOptionPane.showInputDialog(null, > g(null, "Enter Year of Birth:"); > //Validate B Year > while(!(emp.isNumeric(byear, 1930, 1984) && > 984) && byear.length() == 4 )){ > if (emp.isNumeric(byear, 1930, 1984) && > 0, 1984) && byear.length() == 4) { > byearValue = Integer.parseInt(byear); > > } > else { JOptionPane.showMessageDialog(null, > ialog(null, "Invalid Year Value"); > byear = JOptionPane.showInputDialog(null, "Enter Year > ar of Birth"); > } > > } > aEmp.setBYear(byearValue); > > > I believe the problem is that byearValue is being > destroyed before I set it in another class... I tried > moving aEmp.setBYear(byearValue); into the if statement > but still had same problem when I do call getBYear from > the other class, I get "0" eekk, Well I don't know all > that much about java but hope you can help
|
|