मराठी

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(S).toUpperCase(); - Computer Applications

Advertisements
Advertisements

प्रश्न

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(S).toUpperCase(); 
System.out.println(h); 
System.out.println(k.equalsignoreCase(h)); 
लघु उत्तर
Advertisements

उत्तर

Output:
art
true

shaalaa.com
  या प्रश्नात किंवा उत्तरात काही त्रुटी आहे का?
पाठ 4: String Handling - Review Insight [पृष्ठ २८५]

APPEARS IN

अविचल Computer Applications [English] Class 10 ICSE
पाठ 4 String Handling
Review Insight | Q 12. | पृष्ठ २८५

संबंधित प्रश्‍न

Write the output for the following :

String s1 = “phoenix”; String s2 =”island”;

System.out.prindn (s1.substring(0).concat (s2.substring(2)));

System.out.println(s2.toUpperCase( ));


String x[ ] = {“Artificial intelligence”, “IOT”, “Machine learning”, “Big data”};
Give the output of the following statements:

(i) System.out.prindn(x[3]);
(ii) System.out.prindn(x.length);


A tech number has even number of digits. If the number is split in two equal halves, then the square of sum of these halves is equal to the number itself. Write a program to generate and print all four-digit tech numbers.

Example :
Consider the number 3025
Square of sum of the halves of 3025 = (30+25)2
= (55)2
= 3025 is a tech number.


String x[] = {“SAMSUNG”, “NOKIA”, “SONY”, “MICROMAX”, “BLACKBERRY”};

Give the output of the following statements:

  1. System.out.println(x[1]);
  2. System.out.println(x[3].length()); 

Write the output for the following :

String s= “Today is Test”;
System.out.println(s.indexOf(‘T’)); System.out.println(s.substring(0, 7) + ” ” + “Holiday”);


What is the function of catch block in exception handling? Where does it appear in a program?


Write the output for the following :

System.out.printIn(“Incredible” + “\n” + “world”);


If int y = 10 then find int z = (++y * (y++ +5));


Rewrite the following program segment using if-else statements instead of the ternary operator: 
String grade = (mark >= 90) ? “A” : (mark >= 80) ? “B” : “C”;


Give the output of the following method:

public static void main (String [] args)
{
int a = 5;
a++;
System.out.println(a);
a -= (a--) − (--a); 
System.out.println(a);
}

Share
Notifications

Englishहिंदीमराठी


      Forgot password?
Use app×