K
K
koshiii2014-08-29 10:45:07
Java
koshiii, 2014-08-29 10:45:07

Why does the construct work (java)?

www.quizful.net/interview/java/rewrite-a-code-with...
I'm interested in the answer:
if(System.out.printf("Hello world") == null){}
what does that even mean?
why is the helloworld still displayed if the condition body is empty?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Eugene, 2014-08-29
@koshiii

Because the System.out.printf("Hello world") call is executed first, and only after that the result of the System.out.printf("Hello world") call is compared to null

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question