मराठी

Given that: String sp = "Spectroscорy"; String sq = sp.substring(8); What will be the value of sq?

Advertisements
Advertisements

प्रश्न

Given that:

String sp = "Spectroscорy";

String sq = sp.substring(8);

What will be the value of sq?

पर्याय

  • scopy

  • copy

  • opy

  • Error

MCQ
Advertisements

उत्तर

copy

Explanation:

The substring(8) method extracts all characters starting from index position 8 to the end of the string. Since Java uses zero-based indexing, counting from 0 places index 8 on the letter 'c', isolating the word copy.

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 10: String Handling - Exercises [पृष्ठ २४५]

APPEARS IN

रूपा पंडित Computer Applications [English] Class 10 ICSE
पाठ 10 String Handling
Exercises | Q 1. (v) | पृष्ठ २४५
Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×