java - I am getting a null value when i am trying to access a string defined in the superclass from the sublass -
my code is:
public class register_window extends javax.swing.jframe { string u; . . . private void jbutton1actionperformed(java.awt.event.actionevent evt) { try { . . u=jtextfield.gettext(); . . } } } public class data_storer extends register_window { public vector people_database() throws exception { . . . system.out.println("the name of user printed in data_storer(inherited register_window) is:" + u); . . . } }
you need initialize u. you're making assumption jbutton1actionperformed
called before people_database
.
Comments
Post a Comment