What will be the output of substring(0,0) in java?
Pankaj GuptaScholar
Asked: 5 hours ago2025-07-05T09:31:18+05:30
2025-07-05T09:31:18+05:30In: Information Technology
What will be the output of substring(0,0) in java?
Share
You must login to add an answer.
Need An Account, Sign Up Here
Related Questions
- What is the difference between whitespace and unicode space character.
- Is blockchain still relevant for startups in 2025, or has ...
- What emerging technologies (e.g., quantum computing, metaverse) will dominate the ...
- How will AI advancements like ChatGPT and Quora’s Poe reshape ...
- Could You Explain Meta's Open-Source Strategy in AI System Development?
In Java, the substring(int beginIndex, int endIndex) method returns a new string starting from beginIndex (inclusive) and ending at endIndex (exclusive). Example: String str = "example"; System.out.println(str.substring(0, 0)); Output: "" This means an empty string is returned. Explanation: beginIndRead more
In Java, the substring(int beginIndex, int endIndex) method returns a new string starting from beginIndex (inclusive) and ending at endIndex (exclusive).
Example:
String str = “example”;
System.out.println(str.substring(0, 0));
Output: “”
This means an empty string is returned.
Explanation:
beginIndex = 0 (inclusive)
endIndex = 0 (exclusive)
No characters are selected, so the result is an empty string “”.
See less