Java Extends value not updating
Posted
by
James116
on Programmers
See other posts from Programmers
or by James116
Published on 2012-12-06T03:52:33Z
Indexed on
2012/12/06
5:19 UTC
Read the original article
Hit count: 153
java
I am currently working on a hibernate project(EJB and JSF), and i have multiple java classes. The data of parent is being change in the front end with JSF, however, it is not updating in the child class. Any idea as to what could be causing this?
This is what i was doing.
public class parent{
private String x = "UNKNOWN";
//Getters and setters
public getX(){
}
}
public class child extends parent{
public string y{
//this is return UNKNOWN
//instead of the new value being change by the user
System.out.print(getX());
}
}
Thanks in advance
© Programmers or respective owner