please explain this prog

please explain this prog

can u explain this 
import java.io.*;
class SString{
    public static void main(String ar[]) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Enter string: ");
    String name=br.readLine();
    System.out.println("You have entered: "+name);
} 
}
View Answers

January 18, 2011 at 11:33 AM

Hi Friend,

Your code reads the input from the user and display back the output.

The class InputStreamReader(System.in) allows the user to input string on the console. The method br.readLine() of BufferedReader class reads the input from the console. And using println() method displayed the entered value on the console.

Hope that it will be helpful for you.

Thanks









Related Tutorials/Questions & Answers:
please explain this prog
please explain this prog  can u explain this import java.io.*; class SString{ public static void main(String ar[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in
please explain this prog
please explain this prog  import java.io.*; class Studar{ public static void main(String ar[]) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); System.out.println("how many
Advertisements
please help me in these prog
please help me in these prog   create 2 jdbc programs including awt create 2 jdbc programs including swing create 2 jdbc programs including command line argument create 2 jdbc programs including io class 4 jdbc prog using
please explain this program
please explain this program  public class MainClass { public static void main(String[] args) { System.out.println("Java
Please explain Hibernate Sessionfactory.
Please explain Hibernate Sessionfactory.  Hi there, Please explain Hibernate session factory in detail. I have just started learning hibernate so i..., the tutorials here will help you learn Hibernate and will explain about hibernate
Please explain @interface with an example
Please explain @interface with an example  Here is the code snippet...) private Runnable runnable; where Runnable is an interface. Could you please explain what does all these mean? How all these work
Please explain @interface with an example
Please explain @interface with an example  Here is the code snippet: @Retention(RUNTIME) @Target({ FIELD }) public @interface InjectProperty... runnable; where Runnable is an interface. Could you please explain what does
Please explain the logic....
Please explain the logic....  class A1 { } class B extends A1 { } public class ComingThru { static String s = "-"; public static void main(String[] args) { A1[] aa = new A1[2]; B[] ba = new B[2
Please explain me the flow of this program..
Please explain me the flow of this program..  // Substring replacement. class StringReplace { public static void main(String args[]) { String org = "This is a test. This is, too."; String search
please explain me the flow of this program
please explain me the flow of this program  class Bticket extends Thread { Object train,comp; Bticket(Object train,Object comp){ this.train=train; this.comp=comp; } public void run(){ synchronized
Please explain what is hibernatetemplate with an example code.
Please explain what is hibernatetemplate with an example code.  hi, Please explain Hibernate template example code to me..   Hello Friend... is org.springframework.orm.hibernate.HibernateTemplate Please follow the given link for more details: hibernateTemplate
Please write code for this program in java and Explain it ? pl'sssssssss
Please write code for this program in java and Explain it ? pl'sssssssss  Question: We are given an array of 2n integers wherein each pair in this array of integers represents the year of birth and the year of death
403 Forbidden error - What is 403 Forbidden error, please explain...
403 Forbidden error - What is 403 Forbidden error, please explain...  Can anyone please explain, What is 403 Forbidden error. And how can i remove this error, which is restricting my page from loading it. Thanks!!   Hi
In tag files,does attribute values accept expressions or not? If not please explain the reason
.... could any body explain this please............** HTTP Status 500 - type...In tag files,does attribute values accept expressions or not? If not please explain the reason  **Actually when i do manually in tomcat server
servlet prog - Java Interview Questions
servlet prog  how to forward or redirect the client request from servlet to jsp? how a thread or request pass from one servlet prog to one jsp prog? is it possible of communicating from servlet to jsp prog? please explain briefly
403 Forbidden error - What is 403 Forbidden error, please explain...
403 Forbidden error - What is 403 Forbidden error, please explain...  Can anyone please explain, What is 403 Forbidden error. And how can i remove this error, which is restricting my page from loading it. Thanks!!   Ok
Please explain this code as many packages and classes are unknown to me .!
Please explain this code as many packages and classes are unknown to me .!  print("code sample");package bluetooth; import java.io.OutputStream; import javax.microedition.io.Connector; import javax.obex.ClientSession; import
question "writing prog"
question "writing prog"  Hello I want helping for this question, please Write a program that reads some friendsā?? names, stores them in an array, and then prints out on the screen all friends who start by a particular letter
NEED A PROG
NEED A PROG   whats the program to add,delete, display elements of an object using collecions. without using linked list   Hi Friend, Try the following code: import java.util.*; class CollectionExample { public
turbo C prog.
turbo C prog.  Is is possible print ASCII value of a alphabets using turbo C prog
ModuleNotFoundError: No module named 'prog'
ModuleNotFoundError: No module named 'prog'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'prog' How to remove the ModuleNotFoundError: No module named 'prog' error
turbo C prog. Q3
turbo C prog. Q3  What is the difference between if and ladder if ? Describe ladder if with example. What is the purpose of the parameter passing ? please Describe with example.   if statement is used to write
java prog que
java prog que  create a class that returns the reverse of each word in the given string. For example if we give "who are u?" as input, it should return "ohw era u
Explain - LDAP
Explain LDAP  Any one explain about LDAP ? and also explain about JNDI what relation b/w this two
Solution to C prog
Solution to C prog   Hi, Pls any body help, why the following prog crashing while running. #include<stdio.h> #include<conio.h> int main(){ int n,*fact(int *n); printf("Enter the number:"); scanf
ModuleNotFoundError: No module named 'func_prog'
ModuleNotFoundError: No module named 'func_prog'  Hi, My Python... 'func_prog' How to remove the ModuleNotFoundError: No module named 'func_prog' error? Thanks   Hi, In your python environment you
make a prog for this query
make a prog for this query  write a program implementing interface for personal data n salary details. interface must contain abstract methods. steps for the program are 1) store the data in text file 2)display salary when emp id
turbo C prog.
turbo C prog.  Is it possible to print ASCII value A to Z with out using scan ? also give to simple example of binary search ...   #include<stdio.h> #include<conio.h> void main() { for(char c='A';c<
Explain ServletContext.
Explain ServletContext.  Explain ServletContext.   Hi, Here is the answer,ADS_TO_REPLACE_1 ServletContext interface is a window for a servlet to view it?s environment. A servlet can use this interface to get
Prog Error - JSP-Servlet
Prog Error   Place Ad function Browse() { Advertisement Management System Create Ad State: City: Main Category: Sub Category: Title
Java entry prog.
Java entry prog.  Dear sir I will enter the dept code, dept name and insert into dept_mast and save. Pl. Dept_mast Dept_code Char(2) Primary key (no duplicate key allowed) Dept_name Char(25
(ForPro) turbo C prog. Q4
(ForPro) turbo C prog. Q4  I need to learn some easy foxpro program.. for example sum,interchange, loop etc
Explain WML
Explain WML  hii, What is WML?   hello,ADS_TO_REPLACE_1 WML stands for Wireless Markup Language. It is a simple language used to create applications for small wireless devices like mobile phones. WML is analogous
explain this method
explain this method   i hope any one can explain this method ` private void showMonth(int m, int y) { int lead_spaces = 0; if (m &lt; 0 || m > 11) { System.out.println("It should be 1 to 12
Spring Hello World prog - Spring
Spring Hello World prog  I used running the helloworld prog code... in the web.xml file, is it the reason I'm getting nullpointer exception. please...:489) at java.lang.Thread.run(Unknown Source)  Hi Friend, Please
Explain various access modifiers and their visibility.
Explain various access modifiers and their visibility.  Explain various access modifiers and their visibility.   Please visit the following link: Java Access Modifiers
Explain Hibernate Relationships with example.
Explain Hibernate Relationships with example.  Hello, Please explain various hibernate relationships. And if you can provide some examples that would be a great help.. Thank you....   Hi, Hibernate relational
ModuleNotFoundError: No module named 'prog-edu-assistant-tools'
ModuleNotFoundError: No module named 'prog-edu-assistant-tools'  Hi...: No module named 'prog-edu-assistant-tools' How to remove the ModuleNotFoundError: No module named 'prog-edu-assistant-tools' error? Thanks  
ModuleNotFoundError: No module named 'prog_lang_detector'
ModuleNotFoundError: No module named 'prog_lang_detector'  Hi, My... named 'prog_lang_detector' How to remove the ModuleNotFoundError: No module named 'prog_lang_detector' error? Thanks   Hi, In your
Explain normalization concept?
Explain normalization concept?  Explain normalization concept
Explain unescape() and escape() in JavaScript?
Explain unescape() and escape() in JavaScript?  Explain unescape() and escape() in JavaScript
ModuleNotFoundError: No module named 'explain'
ModuleNotFoundError: No module named 'explain'  Hi, My Python... 'explain' How to remove the ModuleNotFoundError: No module named 'explain... to install padas library. You can install explain python with following command
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
PKG_PROG_PKG_CONFIG: command not found
PKG_PROG_PKG_CONFIG: command not found  Hi, How to solve PKGPROGPKG_CONFIG: command not found error This error is coming while executing the configure script. Thanks
Explain types of java programs
Explain types of java programs  Explain types of java programs   Types of Java Programs: Standalone Applications Web Applications Enterprise Applications Console Application Web services
java please please help
java please please help  Dear Friends plz help me to complete this program import java.util.*; public class StringDemo { static String a="{a=100;b=200;c=300}"; public static void main(String args
please tell me
please tell me  class Person{ int age; String name; void Person1...()); obj1.talk(); obj2.talk(); } } in this prog, there is class name as person1, but its compiled and run successfully, please tell me the reason

Ads