0% found this document useful (0 votes)
6 views1 page

String Based Task 2

Uploaded by

isharai8584
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views1 page

String Based Task 2

Uploaded by

isharai8584
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

String Based Task 2

1. Write a program that accepts an array by 10 names and


display all names that end with “h”.

2. Write a program that accepts an array by 10 names and


display all names that contain “he”.

3. Write a program in java to extract a substring from a given


string.
Test Data :
Input the string : this is test string
Input the position to start extraction :9
Input the length of substring :4
Expected Output :
The substring retrieve from the string is : " test "

4. Write a program in java to print individual characters of string


in reverse order.
Test Data :
Input the string : welcome
Expected Output :
The characters of the string in reverse are :
emoclew

5. Write a program in java to count the total number of words in


a string.
Test Data :
Input the string : welcome to bhopal
Expected Output :
Total number of words in the string is : 3

By Ram Lovewanshi

You might also like