64 778
Assignments Done
99,3%
Successfully Done
In September 2018

Answer to Question #3490 in Java | JSP | JSF for Y mukundareddy

Question #3490
Write a program to find the character at 6th place in the following string?
String str=”Hello world”
Expert's answer
import java.io.*;


public class Character6Finder
{
public static void main(String[] args) throws IOException
{
BufferedReader bReader = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Enter the string: ");
String inputStr = bReader.readLine();
if (inputStr.length() >= 6)
System.out.println("The 6th of this string = '" + inputStr.charAt(5) + "'");
else
System.out.println("The string contains less than 6 characters");
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions