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



1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual wo..

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

1) Find the Merge point of two linked lists. 2) Swap two bits of integer. 3) Reverse individual wo..

Answer / santosh kumar

refer to net

Is This Answer Correct ?    3 Yes 4 No

Post New Answer

More Core Java Interview Questions

What are different types of access modifiers?

3 Answers  


Can we rethrow the same exception from catch handler?

0 Answers  


What is variable argument in java?

0 Answers  


what is heap memory?

0 Answers   Tavant Technologies, Zensar,


What is isa relationship?

0 Answers  






Can an interface have a constructor?

0 Answers  


Is arraylist an object in java?

0 Answers  


What is assembly used for?

0 Answers  


What is object-oriented programming?

0 Answers  


can java object be locked down for exclusive use by a given thread? : Java thread

0 Answers  


what is the need of the Ajax?

5 Answers   iFlex,


What are different types of arrays?

0 Answers  


Categories