Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

java.lang.nullpointerexception

// Nullpointer
class Cat{
  String name;
  double weight;
  
  public Cat(String name,double weight){
    this.name=name;
    this.weight=weight;
  }
  public String getName(){
    return this.name;
  }
  public static void main(String[]args){
    Cat cat;// nullpoiterexception;
    cat.getName();
  }
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
3+4 =