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 a code to create a trigger to call a stored procedure
What is the technique adopted to create an immutable class?
Define packages in java?
Is java a utf 8 string?
Why java doesn’t support multiple inheritances?
What will happen if we write code like: try{}catch(exception e)catch(IOException i)
Can a constructor call another constructor?
What is javac_g?
Why does the integer quotient -0/3 yield 0, but the double quotient -0.0/3.0 yields – 0.0?
What is collection class in java? List down its methods and interfaces.
what are the major differences between jdk1.4 and jdk1.5?
2 Answers Cap Gemini, Crimson Logic, Infosys, TCS, Tenth Planet,
What happens if an exception is throws from an object's constructor?