fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. public class Employee
  13. {
  14. private String name;
  15. private int age;
  16. private String designation;
  17. private double salary;
  18.  
  19. public Employee(String n,int a,String d,double s)
  20. {
  21. name=n;
  22. age=a;
  23. designation=d;
  24. salary=s;
  25. }
  26.  
  27. public void setName(String EmpName)
  28. {
  29. n=Empname;
  30. }
  31. public void setAge(int EmpAge)
  32. {
  33. a=EmpAge;
  34. }
  35. public void setdesignation(String EmpDesignation)
  36. {
  37. d=EmpDesignation;
  38. }
  39. public void SetSalary(double EmpSalary)
  40. {
  41. s=EmpSalary;
  42. }
  43. public String Name()
  44. {
  45. return name;
  46. }
  47. public int Age()
  48. {
  49. return age;
  50. }
  51. public String Designation()
  52. {
  53. return designation;
  54. }
  55. public double Salary()
  56. {
  57. return salary;
  58. }
  59.  
  60. public void printDetails()
  61. {
  62. System.out.println("Name:"+Name);
  63. System.out.println("Age:"+Age);
  64. System.out.println("Designation:"+Designation);
  65. System.out.println("Salary:"+Salary);
  66. }
  67. public static void main (String []args)
  68. {
  69. Employee emp1=new Employee("LUCK",21,"manager",50000);
  70. emp1.printDetails();
  71. }
  72. }
  73. }
  74. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:12: error: illegal start of expression
public class Employee
^
1 error
stdout
Standard output is empty