πŸ“Š JAVA
Q. What could be output of the following fragment of code?
Code:
public class Test{
        public static void main(String args[]){ 
  String x = "hellow";
  int y = 9;
  System.out.println(x += y);
        } 
}
  • (A) Throws an exception as string and int are not compatible for addition
  • (B) hellow9
  • (C) 9hellow
  • (D) 9hellowD.Compilation error
πŸ’¬ Discuss
βœ… Correct Answer: (B) hellow9

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
62
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Pooja
Publisher
πŸ“ˆ
89%
Success Rate