Output Questions for Class 10 ICSE Computer Applications
Java String Handling
Give the output of the following string functions:
- "MISSISSIPPI".indexOf('S') + "MISSISSIPPI".lastIndexOf('I')
- "CABLE".compareTo("CADET")
View Answer40 Likes
Java String Handling
State the output when 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));
View Answer21 Likes
Java String Handling
Write the output for the following:
String s1 = "Life is Beautiful"; System.out.println("Earth" + s1.substring(4)); System.out.println(s1.endsWith("L"));
View Answer33 Likes
Java String Handling
Give the output of the following program:
public class StringCheck { boolean foo(String str) { int x = str.compareTo("INCOMMUTABLE"); System.out.println("x=" + x); boolean ret = x == 0 ? true : false; return ret; } public static void main(String[] args) { StringCheck obj = new StringCheck(); boolean a = obj.foo("INCOMPUTABLE"); System.out.println(a); } }
View Answer15 Likes
Java String Handling
Consider the below function:
void strop(String s) { char a = s.charAt(3); int b = s.indexOf('M'); String t = s.substring(3,6); boolean p = s.equals(t); System.out.println(a + " " + b + " " + t + " " + p); }
What will be the output for strop("COMPUTER")?
View Answer10 Likes
Java Operators
What will be the output when the following statements are executed?
int v,s,n=550; s = n + v > 1750? 400:200;
When,
(a) v = 500
(b) v = 1500
View Answer14 Likes
Java Operators
If a = 0, b = 30, c = 40; then find the value of 'a' when:
a += --b + c++ + b;
View Answer43 Likes
Java Operators
Evaluate the following expressions if the values of the variables are a = 2, b = 3, and c = 9.
(a) a - (b++) * (--c);
(b) a * (++b) % c;
View Answer230 Likes
Java Operators
What will be the output of the following if x = 5 initially?
(a) 5* ++x;
(b) 5* x++;
View Answer161 Likes
Java Operators
If a = 5, b = 9, calculate the value of a in the following expression:
a += a++ - ++b + aView Answer220 Likes
Showing 91 - 100 of 147 Questions