0

I am unable to get output . What should I do ??

import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; class Employee{ String name; int id; int age; Employee(String name, int age, int id){ this.name = name; this.age = age; this.id = id; } public void displayDetails(){ System.out.println("Name: "+this.name); System.out.println("Age: "+this.age); System.out.println("Id: "+this.id); } } public class ReadData { public static void main(String args[]) throws IOException { BufferedReader reader =new BufferedReader(new InputStreamReader(System.in)); System.out.println("Enter your name: "); String name = reader.readLine(); System.out.println("Enter your age: "); int age = Integer.parseInt(reader.readLine()); System.out.println("Enter your Id: "); int id = Integer.parseInt(reader.readLine()); Employee std = new Employee(name, age, id); std.displayDetails(); } }

10th Apr 2022, 9:53 AM
Vijay Sharma
1 Answer
+ 1
Vijay Sharma Program is Working, just take input like this: AJ 25 12345 Now enter
10th Apr 2022, 10:26 AM
A͢J
A͢J - avatar