fork download
  1. package topica.moduel;
  2.  
  3. import java.io.Serializable;
  4. import java.util.Scanner;
  5.  
  6. public class NhanVien implements Serializable {
  7.  
  8. /**
  9. *
  10. */
  11. private static final long serialVersionUID = 1L;
  12. private String name,ID;
  13. private Time age;
  14. private double luong;
  15. //15d140159
  16. private String mau ="\\d{2}{c|C|d|D}";
  17.  
  18. static Scanner sc = new Scanner(System.in);
  19.  
  20. public NhanVien() {
  21. // TODO Auto-generated constructor stub
  22. }
  23.  
  24. public NhanVien(String name, String iD, Time age, double luong) {
  25. super();
  26. this.name = name;
  27. ID = iD;
  28. this.age = age;
  29. this.luong = luong;
  30. }
  31.  
  32. public String getName() {
  33. return name;
  34. }
  35.  
  36. public void setName(String name) {
  37. this.name = name;
  38. }
  39.  
  40. public String getID() {
  41. return ID;
  42. }
  43.  
  44. public void setID(String iD) {
  45. ID = iD;
  46. }
  47.  
  48. public Time getAge() {
  49. return age;
  50. }
  51.  
  52. public void setAge(Time age) {
  53. this.age = age;
  54. }
  55.  
  56. public double getLuong() {
  57. return luong;
  58. }
  59.  
  60. public void setLuong(double luong) {
  61. this.luong = luong;
  62. }
  63.  
  64. @Override
  65. public String toString() {
  66. // TODO Auto-generated method stub
  67. return "ID : "+this.ID+"||"+"Name : "+this.name+"||" +"Date of Birth : "+this.age.day+"/"+this.age.month+"/"+this.age.years+"||"+"Lương : "+this.luong+"$"+"||";
  68. }
  69.  
  70. public void inputInformation()
  71. {
  72. System.out.print("Nhập ID : ");
  73. this.ID = sc.nextLine();
  74. System.out.print("Nhập name: ");
  75. this.name = sc.nextLine();
  76. Time t = new Time();
  77. t.input();
  78. this.age = t;
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85. }
  86.  
  87.  
  88.  
  89.  
  90. }
  91.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:6: error: class NhanVien is public, should be declared in a file named NhanVien.java
public class NhanVien implements Serializable {
       ^
Main.java:13: error: cannot find symbol
	private Time age;
	        ^
  symbol:   class Time
  location: class NhanVien
Main.java:24: error: cannot find symbol
	public NhanVien(String name, String iD, Time age, double luong) {
	                                        ^
  symbol:   class Time
  location: class NhanVien
Main.java:48: error: cannot find symbol
	public Time getAge() {
	       ^
  symbol:   class Time
  location: class NhanVien
Main.java:52: error: cannot find symbol
	public void setAge(Time age) {
	                   ^
  symbol:   class Time
  location: class NhanVien
Main.java:76: error: cannot find symbol
    	Time t = new Time();
    	^
  symbol:   class Time
  location: class NhanVien
Main.java:76: error: cannot find symbol
    	Time t = new Time();
    	             ^
  symbol:   class Time
  location: class NhanVien
7 errors
stdout
Standard output is empty