0% found this document useful (0 votes)
6 views2 pages

Java Input Output Techniques Explained

The document provides notes on Java, specifically focusing on wrapper classes and input/output methods. It includes examples of using BufferedReader and Scanner for reading user input, demonstrating how to capture a user's name and address or age. The code snippets illustrate the functionality of these input methods in Java programming.

Uploaded by

arpitasri1305
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views2 pages

Java Input Output Techniques Explained

The document provides notes on Java, specifically focusing on wrapper classes and input/output methods. It includes examples of using BufferedReader and Scanner for reading user input, demonstrating how to capture a user's name and address or age. The code snippets illustrate the functionality of these input methods in Java programming.

Uploaded by

arpitasri1305
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

JAVA NOTES

WRAPPER CLASS: We can wrap primitive value in wrapper class


objects .
INPUT OUTPUT IN JAVA:
1. BUFFERED INPUT OUTPUT:
import [Link].*;
import [Link];
import [Link];
class main{
public static void main (String [] args){
BufferedReader reader = new BufferedReader( new
InputStreamReader([Link]));
String name,address;

try{

[Link]("ENTER YOUR NAME ");


name=[Link]();
[Link]("NAME= "+name);
[Link]("ENTER YOUR ADDRESS ");
address=[Link]();
[Link]("ADRESS= "+address);
}
catch(Exception e){
}

}}
Output:
ENTER YOUR NAME
Arpita Srivastava
NAME= Arpita Srivastava
ENTER YOUR ADDRESS
Neetikhand III indirapuram ghaziabad
ADRESS= Neetikhand III indirapuram Ghaziabad

2. Scanner method :
import [Link].*;
class easy{
public static void main(String [] args){
Scanner scn = new Scanner([Link]);
[Link]("enter your name");
String name= [Link]();

[Link]("YOUR NAME : "+name);


[Link]("enter your age");
int age = [Link]();
[Link]("YOUR AGE : "+age);
}
}
Output:
enter your name
Arpita
YOUR NAME : Arpita
enter your age

20
YOUR AGE : 20

You might also like