हिंदी

Write the output of the codes given below. String sa = "Success is a journey"; String sb = "It is not a destination"; int p1 = sa.lastIndexOf('b');

Advertisements
Advertisements

प्रश्न

Write the output of the codes given below.

String sa = "Success is a journey"; String sb = "It is not a destination";
int p1 = sa.lastIndexOf('b');    String ta = sa.substring (0, p1);
p1 = ta.lastIndexOf('b');        ta = ta.substring (0, p1);
int p2 = sb.indexOf ('b');     String tb = sb.substring (p2+1);
p2 = tb.indexOf('b');     tb = tb.substring (p2);
ta = ta.concat (tb); System.out.print("Finally we can say :: "+ta);
अति संक्षिप्त उत्तर
Advertisements

उत्तर

Finally we can say :: Success is not a destination

shaalaa.com
  क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 10: String Handling - Exercises [पृष्ठ २४७]

APPEARS IN

रुपा पंडित Computer Applications [English] Class 10 ICSE
अध्याय 10 String Handling
Exercises | Q 2. (f) | पृष्ठ २४७
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×