English

Write the output of the codes given below. String ra ="Failure is not failing.";String rb ="Failure is, giving up."; int p1 = ra.indexOf(′ b'); // b indicates one space

Advertisements
Advertisements

Question

Write the output of the codes given below.

String ra ="Failure is not failing.";String rb ="Failure is, giving up.";
int p1 = ra.indexOf(′ b');     // b indicates one space   
String ca = ra.substring(0, p1);    boolean v = rb.startsWith(ca);
System.out.println(" ca = "+ ca);   System.out.println(" V =" +v);
Very Short Answer
Advertisements

Solution

ca = Failure

V = true

shaalaa.com
  Is there an error in this question or solution?
Chapter 10: String Handling - Exercises [Page 247]

APPEARS IN

Rupa Pandit Computer Applications [English] Class 10 ICSE
Chapter 10 String Handling
Exercises | Q 2. (e) | Page 247
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×