| What is the output for below Java string substring keyword?
Choose the correct option from below list
(1)Prints “Str”
(2)Runtime Exception
(3)IndexOutOfBoundsException Runtime Exception
(4)StringIndexOutOfBoundsException Compile-time error
Answer:-(2)Runtime Exception
Note:-Substring have start and endvaluesindex as 3 is smaller than 5 which product error it should be 6 and more. | | |