Home / Board / ICSE / important Questions / Class 10 / Computer Application / String handling
Table of Contents
Ans. ()
Explanation:
str. substring(5,12) returns characters from index 5 to 11 which are 7 characters.
Ans. (a) 20218
Explanation:
substring(4) returns characters from index 4 to the end, that is “2021” and length() function returns the length() of the string that is 8. Concatenation of the two gives 20218.
Explanation:
String can be created by two methods :
(i) From string literal :
e.g. : String str = “Welcome”;
(ii) Using new keyword :
e.g. : char.str[] = {‘w’, ‘e’, ‘I, ‘c’,‘o‘, ‘m’, ‘e’};
String str1 = newString(str);
System.out.println(str1);
Explanation:
(i) boolean
(ii) double
Explanation:
import java.util.*;
public class Replace
{
public static void main(String args [ ])
{
Scanner sc = new Scanner(System.in);
String name;
int l, i, b, w;
l= 0;
b = 0; w = 0;
char chr; System.out.println(“Enter a String’’);
name = sc.nextLine();
l= name.length();
for(i = 0; i < l; i++) // Loop begins{chr = name.charAt(i);
if(chr = = ‘e’)chr = ‘*’;
System.out.print(chr);
}
// Loop ends
}
}
Download Mind Map of this chapter
Download NowWant to Practice Mock Tests of this chapter
Practice NowDownload Important Questions of this chapter
Download NowChapter No. | Chapter Name |
---|---|
Chapter 1 | Revision of Class IX Syllabus |
Chapter 2 | Class as a Basis of all Computation |
Chapter 3 | User - defined Methods |
Chapter 4 | Constructors |
Chapter 5 | Library classes |
Chapter 6 | Encapsulation |
Chapter 7 | Arrays |
Chapter 8 | String handling |
Chapter Wise Important Questions for ICSE Board Class 10 Computer Applications |
---|
Revision of Class IX Syllabus |
Class as a Basis of all Computation |
User - defined Methods |
Constructors |
Library classes |
Encapsulation |
Arrays |
String handling |
CBSE Important Questions Class 9
CBSE Important Questions Class 10
CBSE Important Questions Class 12
CBSE Practice Papers
CBSE Practice Papers
ICSE Important Questions Class 9
ICSE Important Questions Class 10
ICSE Practice Papers
ISC Important Questions Class 12
ISC Practice Papers
Contact Us
© Copyright 2024 oswal.io by OSWAL PUBLISHERS Simplifying Exams