1) Find the Merge point of two linked lists.
2) Swap two bits of integer.
3) Reverse individual words of the sentence.
4) Reverse string without using temp string.
Answers were Sorted based on User's Feedback
Answer / imran shaik
public class ReverseSentence {
public static void main(String[] args) {
System.out.println("please enter the Sentence");
Scanner input = new Scanner(System.in);
String s1 = input.nextLine();
String s[] = s1.split(" ");
String s3 = "";
int len = s.length;
for (int i = len - 1; i >= 0; i--) {
s3 = s3.concat(s[i]);
s3 = s3.concat(" ");
}
System.out.println(s3.trim());
}
}
| Is This Answer Correct ? | 5 Yes | 2 No |
Write POJO class as a key to hashmap???
what is the difference between @include page and @include file
What is difference between iterator and enumeration in java?
Can we override the private methods?
How do you override a method?
where singleton classes are used in j2ee web application.can we use it for connection pooling.
What are the advantages and disadvantages of object cloning?
Class c implements interface I containing method m1 and m2 declarations. Class c has provided implementation for method m2. Can I create an object of class c?
What are wrapped classes?
Is there any difference between nested classes and inner classes?
What are Access Specifiers and Access Modifiers.
What is general methodology?