()
| 38 | // speed |
| 39 | public double speed; |
| 40 | public void getData() { |
| 41 | System.out.println("Enter employee details: "); |
| 42 | System.out.println("Enter name: "); |
| 43 | name = sc.nextLine(); |
| 44 | System.out.println("Enter employee id: "); |
| 45 | emp_id = sc.nextInt(); |
| 46 | System.out.println("Enter speed: "); |
| 47 | speed = sc.nextDouble(); |
| 48 | } |
| 49 | public void displayData() { |
| 50 | System.out.println("Displaying employee details: "); |
| 51 | System.out.println("Name: " + name); |