This question already has an answer here:
Why following snippet throw NullPointerException
package com.practice.test;
public class Test {
int getValue(){
return (true?null:0);
}
public static void main(String[] args) {
Test t = new Test();
t.getValue();
}
}
Aucun commentaire:
Enregistrer un commentaire