76 315
Assignments Done
Successfully Done
In May 2019

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) + "'");
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions