Day 22 | Daily Java interview question | #java #ocjp #scjp #javacertification

preview_player
Показать описание
Java programming interview questions
#java #ocjp #scjp #javainterviewquestion #javatutorial #interview #learnjava #javascript #javaquestions #javaprogramming
Рекомендации по теме
Комментарии
Автор

Because if statement is already terminated due to the use of semicolon. So that system.out.println("Hello") is not the part of if statement. So that the output getting Hello in this program.

BholaYadav-jw
Автор

Non static block executed and "hello" will print

arvinsuryavanshi
Автор

; means termination of block so it prints next statement which gives hello output

krishnaveni
Автор

The semicolon is terminating the if statement and printing code is written in another block, that's it!

khusi
Автор

Semicolon marks the end of if statement whole sout represent else statement.

lateefadedokun
Автор

Blocks invoked at the time of compilation and if block end with ; which terminate if block instantly

littleace
Автор

; is end of the statement in java bcoz it happens

crazycarrot
Автор

It will give error because of if statement is not end with ;

DipakChavan-tf
Автор

If block is end with semicolon;
And another block start in which the S.o.pln have a message that print as it is....Sopln is in separate block that's why answer is Hello.

monikasingh
Автор

Go and learn c and then c++ and then java then you can understand why output else your whole life will spoil why it printing "Hello"

brahmanandakabi
Автор

We found the missing ; from yesterday bug

TiagoRasia
join shbcf.ru