Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
Java All : String Class Functions


Exam Papers Problems

Using Math.pow and indexOf #3964

( As In Exam - ICSE2015 )

What is the value stored in variable res given below:
double res = Math

What is the value stored in variable res given below:
double res = Math.pow(“345”.indexOf(‘5’), 3);

Use of substring, toUpperCase and equalsIgnoreCase() #3980

( As In Exam - ICSE2015 )

State the output of the following  program segment is executed :

St

State the output of the following  program segment is executed :

String a = "Smartphone", b = "Graphic Art";
String h = a.substring(2, 5);
String k = b.substring(8).toUpperCase();
System.out.println(h);
System.out.println(k.equalsIgnoreCase(h));

Identifying functions by description #3984

( As In Exam - ICSE2015 )

(i) Name the mathematical function which is used to find sine of an angle giv

(i) Name the mathematical function which is used to find sine of an angle given in radians
(ii) Name a string function which removes the blank spaces provided in the prefix and suffix of a string

writing return data types endsWith() log() #4048

( As In Exam - ICSE2018 )

Write the return data type of the following function.
(i) endsWith()

Write the return data type of the following function.
(i) endsWith()
(ii)log()

replace() compareTo() #4063

( As In Exam - ICSE2018 )

Give the output of the following string functions:
(i) “ACHIEVEME

Give the output of the following string functions:
(i) “ACHIEVEMENT”.replace(‘E’,’A’)
(ii)”DEDICATE”.compareTo(“DEVOTE”)

array.length() and substring() #4065

( As In Exam - ICSE2018 )

Consider the following String array and give the output
String arr[]= {

Consider the following String array and give the output
String arr[]= {“DELHI”, “CHENNAI”, “MUMBAI”, “LUCKNOW”, “JAIPUR”};
System.out.println(arr[0].length()>arr[3].length());
System.out.print(arr[4].substring(0,3));

difference between == and equals() #4220

( As In Exam - ICSE2016 )

State the difference between == operator and equals() method.

State the difference between == operator and equals() method.

indexOf lastIndexOf compareTo #4235

( As In Exam - ICSE2016 )

Give the output of the following string functions :
(i) “MISSISSIPPI

Give the output of the following string functions :
(i) “MISSISSIPPI”.indexOf(‘S’) + “MISSISSIPPI”.lastIndexOf(‘I’)
(ii) “CABLE”.compareTo(“CADET”)

isLetterOrDigit() replace() function #4256

( As In Exam - ICSE2016 )

Write the return type of the following library functions :
(i) isLetter

Write the return type of the following library functions :
(i) isLetterOrDigit(char)
(ii) replace(char,char)



Exam Paper Problems:9 
Back