Solve This (? + ? + ?=30)
If 1111=R, 2222=T, 3333=E, 4444=N Then 5555=?
Guess the Hindi Muhawara from the following whatsapp Emoticons?
Sweet, Medicine, Film, Girl, City, Car, Place, Doggy all are name same, guess which word it is?
A girl is blind, deaf, dumb and uneducated too. A boy loves her. How would he propose without touching her?
Four Question, One Answer: One River Name, One Flower Name, One Film Name, One Actress Name?
Guess me who am I, I am the first on earth, the second in heaven...
Which Indian cricketer is known as "Brown Bradman"?
Harold I of England was nicknamed "Harold … " what?
What does the record industry term "A & R" stand for?
class test { static boolean check; public static void main(String args[]) { int i; if(check == true) i=1; else i=2; if(i=2) i=i+2; else i = i + 4; System.out.println(i); } }
Although the program won't run because of if(i=2) but if your condition become if(i==2) instead of if(i=2) then output=4
The program does not compile because of the statement if(i=2).
The statement "i=2" evaluates to 2. The expression within the if block must evaluate to a Boolean.
public class example { int i[] = {0}; public static void main(String args[]) { int i[] = {1}; change_i(i); System.out.println(i[0]); } public static void change_i(int i[]) { i[0] = 2; i[0] *= 2; } }
public class test { public static void main(String args[]) { String s1 = "abc"; String s2 = "abc"; if(s1 == s2) System.out.println(1); else System.out.println(2); if(s1.equals(s2)) System.out.println(3); else System.out.println(4); } }