CORE JAVA,Interview,Interview Questions,String

String vs StringBuffer

15 Aug , 2016  

No. String StringBuffer 1) String class is immutable. StringBuffer class is mutable. 2) String is slow and consumes more memory when you concat ...

CORE JAVA,Interview Questions,String

What does intern() method do in Java?

15 Aug , 2016  

 String object crated by new() operator is by default not added in String pool as opposed to String literal. intern() method allows to put ...

Interview,Interview Questions,String

Why String is Immutable in Java

15 Aug , 2016  

Requirement of String Pool String pool (String intern pool) is a special storage area in Java heap. When a string is created and if the string a...

String

How to count Vowels and Consonants in Java String Word

10 Aug , 2016  

[crayon-5ce59c175c496119855966/]  ...

String

count occurrences of a character in String

10 Aug , 2016  

[crayon-5ce59c175c8fe965333645/]  ...

String

How to program to print first non-repeated character from String?

10 Aug , 2016  

import java.io.IOException; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; impo...

String

How to Print duplicate characters from String?

10 Aug , 2016  

import java.util.HashMap; import java.util.Map; import java.util.Scanner; import java.util.Set;   public class FindDuplicateCharacters{ &nb...

String

Java program to reverse a string

10 Aug , 2016  

import java.util.*;   class ReverseString { public static void main(String args[]) { String original, reverse = “”; Scanner in ...

String

Write a java program to find the duplicate words and their number of occurrences in a string?

10 Aug , 2016  

public class duplicateWordsInString { static void duplicateWords(String inputString) { //Splitting inputString into words String[] words = input...