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 |
Explain java coding standards for classes or java coding conventions for classes?
What is the difference between error and an exception?
what is the difference between static class and singleton class? can we create static class?
2 Answers L&T, Octazen, Vamsi Labs,
what are three ways in which a thread can enter the waiting state? : Java thread
What is multi level inheritance in java?
What is visibility mode?
Is void a data type in java?
Which is easier .net or java?
Explain covariant method overriding in java.
Can we use synchronized block for primitives?
If two threads call a static method at the same point of time, what will happen?
What is difference between path and classpath variables?