Core Java Interview questions


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

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

This method converts this string into character array. It returns a newly created character array, its length is similar to this string and its contents are initialized with the characters of this string.

 




Next 5 interview question(s)

1

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

2

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

3

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

4

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

5

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