raghu.nagabandi
BAN USERchar temp[] = {'a',' ','a',' ','b',' ','c'};
String sb= new String();
for (int i = 0; i < temp.length; i++) {
if(temp[i]!=' '){
sb=sb+temp[i];
}
}
System.out.println(sb.toString());
please see my approach.
String name="rnagabandi";
HashMap<Character, Integer> hashMap = new HashMap<Character, Integer>();
int temp=0;
hashMap.put(name.charAt(0),1);
for (int i = 1; i < name.length(); i++) {
if(hashMap.get(name.charAt(i))!=null){
temp=hashMap.get(name.charAt(i));
hashMap.put(name.charAt(i),temp+1);
}else{
hashMap.put(name.charAt(i),1);
}
temp=0;
}
System.out.println(hashMap);
Repabbyhgabb, Associate at Abs india pvt. ltd.
Develop fresh content for emails, web banners, site wide communication, and subject lines.Write stories, blogs and related content about ...
RepRebecaMoore, Consultant at AMD
I am working as an art teacher with “Glory High School,” and develop interests for art and creative expression in ...
positive test csaes
- raghu.nagabandi July 16, 2012I. verify whether enter numbers are between 1 to 100.
II. enter numbers between 1 and 10 , 10 and 20 , 30 and 40 , 40 and 50 , 60 and 70 , 70 and 80 , 80 and 90, 90 and 100 , verify the sum
negative test cases
I. enter alphabets and check whther its hows error
II. enter -ve numbers and verify whether it shows error
III. enter 0 or more than 100 and check whether it displays error or not