πŸ“Š JAVA
Q. What will be the output of the following Java program?
class String_demo
{
public static void main(String args[])
{
char chars[] = {'a', 'b', 'c'};
String s = new String(chars);
String s1 = "abcd";
int len1 = s1.length();
int len2 = s.length();
System.out.println(len1 + " " + len2);
}
}
  • (A) 3 0
  • (B) 0 3
  • (C) 3 4
  • (D) 4 3
πŸ’¬ Discuss
βœ… Correct Answer: (D) 4 3

You must be Logged in to update hint/solution

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
301083
Total Visits
πŸ“½οΈ
12 mo ago
Published
πŸŽ–οΈ
Vinay
Publisher
πŸ“ˆ
94%
Success Rate