Lesson 75 Input using BufferedReader class - Part 1

Опубликовано: 31 Август 2024
на канале: JavaJourneyWithMadhavi
15
1

Input using BufferedReader class is discussed with the help of two programs in the Java environment. The first program takes input as a String using readLine() method, int, float and double are read with the help of readLine() and wrapper class methods, char datatype with read() method. The second program reads 4 integers and displays sum and product.

Link to the Book - Essentials of Computer Applications:

https://www.amazon.in/Essentials-Comp...

Link to Integer Wrapper class - lesson 73:
   • Lesson 73 - Part 2- Wrapper classes - Inte...  

Practice Exercise Lesson 75 (Take input using BufferedReader class)

1. Read radius and display area of a circle.
2. Read side value of a square and display area of square.
3. Read length and display area of a rectangle.
4. Write a program to read number of kilometers and display equivalent meters.
5. Guess output of the following.
String d = “5”;
String a = “79”;
int b = Integer.parseInt(d);
int c = Integer.parseInt(a);
System.out.println(b + c);