Preview:
package com.mycompany.testoop;
import java.util.ArrayList;
import java.util.Scanner;
 
 
public class Main {
    static Scanner in = new Scanner(System.in);
    public static void main(String args[]){
          ArrayList <Employees> ourEmployees = new ArrayList();
          for (int i=0; i<4; i++){
              ourEmployees.add(new Employees(in.nextInt(), in.next(), in.nextFloat()));
          }
          for (int i=0; i<ourEmployees.size(); i++){ //10 20 30 
            System.out.println("Employee #" + (i+1) + " ==> " + ourEmployees.get(i) + " ");
        }     
          
    }
    
}
 
 
 
package com.mycompany.testoop;
 
public class Employees {
    private int id;
    private String name;
    private float salary;
    
    // ****************Constructors*******************
    public Employees() {
    }
    public Employees(int id, String name, float salary) {
        this.id = id;
        this.name = name;
        this.salary = salary;
    }
    // ****************Setters & Getters*******************
    public int getId() {
        return id;
    }
 
    public void setId(int id) {
        this.id = id;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name;
    }
 
    public float getSalary() {
        return salary;
    }
 
    public void setSalary(float salary) {
        this.salary = salary;
    }
    // ****************Our Methods*******************
 
    @Override
    public String toString() {
        return  "ID = " + id + ", Name = " + name + ", Salary = " + salary;
    }  
    
}
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter