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

How do you sort in ascending order in java?

0 Answers  


How to know the host from which Applet is originated?

1 Answers   Wipro,


how do you store phone numbers using java collections

5 Answers   Bosch, IBAB,


What is difference between ++ I and I ++ in java?

0 Answers  


byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p?

7 Answers   NIIT, Wipro,


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

0 Answers  


What is the difference between preparedstatement and statement in java?

0 Answers  


how to call one program .class file in another program

7 Answers   TCS,


What language is an assembler written in?

0 Answers  


How does map works in java?

0 Answers  


What is json parser in java?

0 Answers  


What is the difference between C++ and Java and your preferences?

0 Answers   Expedia,


Categories