Hello,
I wonder what does the error:java.lang.NullPointerException means?. I have seen this error in my code many time , but I do not know what exactly this means, if you have an explanation for this then it would be great. Thanks in advance.
Printable View
Hello,
I wonder what does the error:java.lang.NullPointerException means?. I have seen this error in my code many time , but I do not know what exactly this means, if you have an explanation for this then it would be great. Thanks in advance.
Hello,
This error occurs we call a method on an uninitialized variable.
For example:
To help should show us the source code. And also if you need an example on this and an explanation then visit the Sun's official site for more information.Code:mObject tmp;
tmp.exMethod ();
Causes NullPointerException.
Hello,
Check out this example for more understanding
Code:Public class mobj{
Public mobj()
{
...
}
Public int exmethod(){
...
}
Public static void hand(String[] args){
mobj o;
int value = o.exmethod();
}
Hello,
Here is my code:
in the main class:
See, if you can help me with this.Code:Public void actionPerformed(ActionEvent e)
{
String tx = entry.getText();
se.selectAll();
se.cut();
add(login, tx);
Sys.listen(login, tx); / / answer in terms of tx
}
Hello,
I think your variable / attribute s has been initialized? I think you need to change this.
I am not sure but I think you have a problem in this line, see if you can eliminate this line from your code and try some other alternative for this.Code:System.out.System.out.println(s == null);
Hello,
I think I have a solution for this . just have a look at the example below
Code:/ / Instantiate the dialog engine
Sys s = new Sys (var, rulefile, "");
but when it is sent to the following code:
public void actionPerformed (ActionEvent e)
{
se.getText String tx = ();
se.selectAll ();
se.cut ();
add (login, tx);
Sys.cout (login, tx) / / answer in terms of tx
}