Core Java Interview questions


Total available count: 646
Subject - Java Technologies
Subsubject - Core Java

When will substring(int startIndex, int endIndex) method throws "StringIndexOutOfBoundsException" in java?

If start index is negative value or end index is lower than starting index,then it throws 'StringIndexOutOfBoundsException' exception.

 




Next 5 interview question(s)

1

Which exception does substring(int startIndex, int endIndex) method of string throws in java?

2

What is the return type of startsWith(String prefix) method of java.lang.String class in java?

3

What the function of startsWith(String prefix) method of String class in java? 

4

When will split(String regex) method throws "PatternSyntaxException" in java?

5

Which exception does split(String regex) method of string throws in java?