Suppose I write a code like this
if(i==100)
{
System.out.println("hello");
}
or I write a code like this
if(i==100) System.out.println("hello");
Will there be any difference in the performance and efficiency of above two codes?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There will be no difference in performance, only readability is less if you leave the brackets out. Also because you need to know that only the first line after your condition will be executed.