I have a class as shown
package com;
public class Person {
boolean registered;
public boolean isRegistered() {
return registered;
}
public void setRegistered(boolean registered) {
this.registered = registered;
}
}
The Data to Person Object will be set based on the Data present in DB . The problem is that for older records the registered filed is not present .
so i how can i test if the filed is present or not ??
package com;
public class Test {
public static void main(String args[]) {
Person per = new Person();
if (per.isRegistered()) {
}
}
}
How can i check if the per.isRegistered() field is present or not for that Person Object ??