Computer Science, asked by asmit50, 2 months ago

Read the following code segment and answer

the question number 61-75.

String s1 = "Lucknow Public School";

String s2 = "Lucknow" ;

String s3 = "College" ;

String s4 = "Luck" ;

Q.61- Output of s1.length( ) is :

a. 19 b. 23

c. 21 d. None of these

Q.62- Output of s2.charAt(3) is :

a. c b. k

c. l d. None of these

Q.63- Output of s1.indexOf('u') is :

a. 1 b. 2

c. 3 d. None of these

Q.64- Output of s2.indexOf('p') is :

a. Error b. –1

c. 3 d. None of these

Q.65- Output of s1.substring(0,7).equals(s2)

is :

a. false b. true

c. 0 d. None of these

Q.66- Output of s1.replace("School", s3) is :

a. Lucknow Public School

b. College

c. Lucknow Public College

d. None of these

Q.67- Output of s2.substring(4) :

a. Luck b. now

c. Luc d. None of these

Q.68- Output of s3.lastIndexOf('l') :

a. 3 b. 2

c. 0 d. None of these

Q.69- Output of

s3.compareTo(s1.substring(0,4)) is :

a. false b. 1

c. 0 d. None of these

Q.70- Output of s1.compareTo(s2) is :

a. 1 b. –1

c. 14 d. None of these

Q.71- Output of s2.endsWith("now") is :

a. true b. false

c. 1 d. None of these

Q.72- Output of s1.charAt(21) is :

a. l b. error

c. –1 d. None of these

Q.73- Output of Math.sqrt(s4.indexOf('u'))

is :

a. 1.414 b. 1.0

c. 1 d. None of these

Q.74- Output of s3.lastIndexOf('l')%2 is :

a. 0 b. 2

c. 1 d. None of these

Q.75- Output of s3.concat("s") is :

a. Colleges b. College s

c. s d. None of these


please answer it ​

Answers

Answered by jai696
6

Q.61- Output of s1.length( ) is: 21

Q.62- Output of s2.charAt(3) is: k

Q.63- Output of s1.indexOf('u') is: 1

Q.64- Output of s2.indexOf('p') is: -1

Q.65- Output of s1.substring(0,7).equals(s2): true

Q.66- Output of s1.replace("School", s3) is: 'Lucknow Public College'

Q.67- Output of s2.substring(4): 'now'

Q.68- Output of s3.lastIndexOf('l'): 3

Q.69- Output of s3.compareTo(s1.substring(0,4)): -9

Q.70- Output of s1.compareTo(s2): 14

Q.71- Output of s2.endsWith("now") is: true

Q.72- Output of s1.charAt(21) is: error

Q.73- Output of Math.sqrt(s4.indexOf('u')) is: 1.0

Q.74- Output of s3.lastIndexOf('l')%2 is: 1

Q.75- Output of s3.concat("s") is: Colleges

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Similar questions