can you program for reverse string?

Answer Posted / pratyush kumar nayak

String Original,Reverse="";
System.out.println("Enter String To Reverse");
Scanner sc=new Scanner(System.in);
Original=sc.nextLine();
int length=Original.length();
for(int i=length-1;i>=0;i--){
Reverse=Reverse+Original.charAt(i);
}
System.out.println("The Reversed String is " + Reverse);

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is string syntax?

557


What are sets in java?

517


What is stored procedure. How do you create stored procedure ?

1505


What string is utf8?

555


Why is string class considered immutable?

602






What is classpath?

556


Explain about main() method in java ?

593


Addition to previous section relative word 5th one was Putrid ans: rotten, also there was prob. in 1st section on bucket weight ans:10kg, also there was a prob. on train speed to find bridge length ans:800 mtrs.

1622


What is ellipsis in java?

591


Why hashmap is used in java?

563


What is an eror in java?

568


For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green  White will have 1 Weight.  Red and Green carry no weights.  Shortest path is the path with less weight when you add up the weights in the path.

1591


What is the difference between a choice and a list?

614


What if static is removed from main method?

582


What is fail first in java?

587