0% found this document useful (0 votes)
16 views

Strings Questions

Uploaded by

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

Strings Questions

Uploaded by

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

STRINGS QUESTIONS

[email protected]
Question 1 : Count how many times lowercase vowels occurred in a String entered by the
user.

Question 2 : What will be the output of the following code?


public class Solution {
public static void main(String args[]) {
String str = "ShradhaDidi";
String str1 = "ApnaCollege";
String str2 = "ShradhaDidi";
System.out.println(str.equals(str1) + " " + str.equals(str2));
}
}

Question 3 : What will be the output of the following code?


public class Solution {
public static void main(String args[]) {
String str = "ApnaCollege".replace("l", "");
System.out.println(str);
}
}

Question 4 : Determine if 2 Strings are anagrams of each other.


What are anagrams?
If two strings contain the same characters but in a different order, they can be said to be
anagrams. Consider race and care. In this case, race's characters can be formed into a study,
or care's characters can be formed into race. Below is a java program to check if two strings
are anagrams or not.

Question 5 : Search and read about


a. intern( ) method in String
b. StringBuffer

You might also like