How to print details in the pattern given in java constructors like this
Write a program that would print the information (name, year of joining, salary, address) of three employees by creating a class named 'Employee'. The output should be as follows:
Name Year of joining Address
Robert 1994 64C- WallsStreat
Sam 2000 68D- WallsStreat
John 1999 26B- WallsStreat
??
Answers
Answered by
15
import java.io.*;
class Employees
{
int y;
String name, adr;
BufferedReader br=new BufferedReader(newInputStreamReader(System.in));
void input();
System.out.println("Enter your year of joining");
y=Integer.parseInt(br.readLine());
System.out.println("Enter your Name");
name=br.readLine();
System.out.println("Enter your addresses");
adr=br.readLine();
}
import java.io.*;
class Company
{
public static void main()throws IOException
Employees emp=new Employees();
emp.input();
}
Hope it helps...
Please mark brainliest
abhishek64491:
Thanks a lot!!
Answered by
0
Answer:
See the answer in attachment file
Explanation:
Attachments:
Similar questions