Job Assured Training at Felight, Bangalore
Home / Old Batches / String Assignment for JMaestro Batch
String Assignment for JMaestro Batch

String Assignment for JMaestro Batch

1. List 20+ methods in String Class by going through JDK documentation
2. Write a method which accepts a string as argument and returns the first letter of every word clubbed into a string.
3. Write a method to reverse a string without using StringBuffer or StringBuilder.
4. A method which returns true if the email address is valid.
5. A method which returns the rating of a movie(1/5, 4/5) if a paragraph of text is given as a input. Here you need to count all the +ve words like good, amazing, better etc and all the -ve words like bad, not good, worst etc and apply a logic to give a rating in number and return it.
6. Write a method which accepts array of strings as input and returns the sorted string array without using comparable or comparator
7. Write a Program to check if a String is palindrome or not? For example an String e.g. “madam” is a palindrome but “book” is not palindrome. You also need to solve this question without taking any help from Java String API.
8. Write a Java program to check if two String are Anagram or not? You need to write method e.g. isAnagram(String first, String second) which will return true if second String is anagram of first string. An anagram must contain same number of characters and exactly same characters but on different order e.g. top and pot, or army and mary.
9. Write a method in Java to remove any character from String? For example you need to write method remove(String word, char removeThis), this method should return an String without character, which is asked to remove. you can use indexOf(), substring() and similar methods from String class, but your method must handle corner cases e.g. passing null or empty String, String containing just one character etc.
10. Write a method to Split a comma separated String in Java?
if send vinay,noah as input put should be new String[]{“vinay”,”noah”}
11. Write Java program to print all permutations of a String e.g. passing “ABC” will print all permutations like “BCA”, “CBA” etc
12. A method which accepts String and a integer as input and return string as many times as the integer without using any API

1. Write an example program to illustrate the important methods present in StringBuilder & StringBuffer (append , reverse , insert , delete, replace, etc).
2. Write a program to append empty string to StringBuilder object & StringBuffer object around 10 lac times and Note the time consumed by both.

About Latha S

Leave a Reply

Your email address will not be published. Required fields are marked *


Scroll To Top