-2
It’s a dumb doubt but why does this code work?
public static void main(String[] args) throws ParseException {
List<String> lista2 = teste();
System.out.println(lista2.toString());
}
In this method I should return a list but have a second 'Return null' it should not be run either?
public static List<String> teste(){
List<String> meu = new ArrayList<String>();
meu.add("iodfsj");
meu.add("jfgfy");
meu.add("ophgkyp");
meu.add("jifrl");
if(true){
return meu;
}
return null;
}
What is the purpose of the code? Why do you have this
null
there? Why do you have thisif true
there?– Maniero