package sara78;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;
import java.lang.IndexOutOfBoundsException;
public class node extends RuntimeException{
private static String string;
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
InputStreamReader input = new InputStreamReader(System.in);
BufferedReader reader = new BufferedReader(input);
try {
string = reader.readLine();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
char[] c=string.toCharArray();
int k=c.length;
for(int i=0;i<=k;i++)
{
System.out.println(""+c[i]);
}
for(int i=k;i<=k;--i)
{
System.out.println(""+c[i]);
}
}
}
As well, you could do it with a different approach, same idea:
import java.util.*;
public class Example
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
System.out.println("Please enter a String to reverse:");
String toReverse = in.next();
String Reversed = "";
for (int i = toReverse.length()-1; i>=0; i--)
{
Reversed = Reversed + toReverse.charAt(i);
}
System.out.println(Reversed);
}
}
The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.
You can create a separate string initially empty. Then using a loop, start at the end of the string and add it to the end of the other string. At the end of the loop, the other string would contain the reverse.
i dont no string for servlate
In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.
what is string
The use of the reverse string in C program is used to reverse the letters in the string. An example would be reverse me would be reversed to em esrever.
You can create a separate string initially empty. Then using a loop, start at the end of the string and add it to the end of the other string. At the end of the loop, the other string would contain the reverse.
The string trim works in Java by trimming white space from the beginning and end of a string. It cleans up the string and makes makes it neater for the users of the program.
i dont no string for servlate
In order to program a reverse auto loan calculator in JAVA, you are going to need a lot of experience with JAVA. There are online tutorials that can help you set up with fundamentals of JAVA so that you will be able to create almost any basic program you want.
what is string
.... String line = "This is example program with spaces"; String[] tokens = line.split(" "); System.out.println(tokens.length-1); .......
You can use the toUpperCase() method on a String to convert any String to all uppercase.
StringBuffer is java class available in java.lang package which provides mutable String object where String is immutable class. The methods of this class like reverse(), append(),insert() gives facility to insert data of the same object.
i am sam
public class HaveAGoodDay { public static void main(String[] args) { for (final String arg : args){ System.out.print(arg +" "); } } } compile and run the program: java HaveAGoodDay have a good day. output: have a good day.
In Java, the executable method is the main method, which serves as the entry point for any standalone Java application. It is defined as public static void main(String[] args), where String[] args allows for command-line arguments to be passed to the program. The main method must be declared as public and static, and it returns no value (void). When a Java program is run, the Java Virtual Machine (JVM) looks for this method to start the execution of the program.