✏️ Explanatory Question

Give the output of the following:

String n = "Computer Knowledge.";  
String m = "Computer Applications";  
System.out.println(n.substring(0, 8).concat(m.substring(9)));  
System.out.println(n.endsWith("e"));

👁 86 Views
📘 Detailed Answer
🟢 Easy
💡

Answer with Explanation


String n = "Computer Knowledge.";  
String m = "Computer Applications";  
System.out.println(n.substring(0, 8).concat(m.substring(9))); 
System.out.println(n.endsWith("e"));

Output:

  • Computer Applications
  • true