nikhil saini

Greenhorn
+ Follow
since May 04, 2015
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by nikhil saini

I don't know how to use code tags??

when I am compiling this code it giving me an error on print employee method that illegal start of expression
I want to run this print employee method inside main.
but its not running showing this Run time exception.?? illegal start of expression

please help me out
4 years ago


package com.example;

import com.example.domain.Admin;
import com.example.domain.Director;
import com.example.domain.Employee;
import com.example.domain.Engineer;
import com.example.domain.Manager;



public class EmployeeTest {

/**
*
* @param args
*/
public static void main(String[] args) {

Employee emp = new Employee(2, "asdddfffg", "123_32_45", 345_54.09);

emp.setName("ghghjgjg");


Engineer eng = new Engineer(1, "jane", "123", 45.27, "cse");


Manager mgr = new Manager(204, "barbara jhonson", "054-12-1818", 109_501.36, "us digital marketing");
mgr.raiseSalary(1000.0);

Admin adm = new Admin(304, "abcd", "125_45_78", 108_501.36, "cse");

Director dir = new Director(308, "wert", "12_87_64", 200_458.98, "cse", 18_78.59);




/**
* @param emp
*
*/

System.out.println(emp);


/**
* @param eng
*/

System.out.println();
System.out.println("Enigineer id:" + eng.getEmpId());
System.out.println("Enigineer Name:" + eng.getName());
System.out.println("EnigineerSSN" + eng.getSsn());
System.out.println("Enigineer salary" + eng.getSalary());
System.out.println("Enigineer department" + eng.getDeptName());


/**
*
* @param adm
*/

System.out.println();
System.out.println("Employee id:" + adm.getEmpId());
System.out.println("Employee Name:" + adm.getName());
System.out.println("Employee SSN" + adm.getSsn());
System.out.println("Employee salary" + adm.getSalary());
System.out.println("Employee department" + adm.getDeptName());


/**
*
* @param mgr
*/

System.out.println();
System.out.println("Employee id:" + mgr.getEmpId());
System.out.println("Employee Name:" + mgr.getName());
System.out.println("Employee SSN" + mgr.getSsn());
System.out.println("Employee salary" + mgr.getSalary());
System.out.println("Employee department" + mgr.getDeptName());



/**
*
* @param dir
*/

System.out.println("");
System.out.println("Employee id:" + dir.getEmpId());
System.out.println("Employee Name:" + dir.getName());
System.out.println("Employee SSN" + dir.getSsn());
System.out.println("Employee salary" + dir.getSalary());
System.out.println("Employee budget" + dir.getBudget());

/**
*
* @param emp
*/

public static void printEmployee(Employee emp){
System.out.println("");
System.out.println("Employee id:" + emp.getEmpId());
System.out.println("Employee Name:" + emp.getName());
System.out.println("Employee SSN" + emp.getSsn());
System.out.println("Employee salary" + emp.getSalary());


}


}




}
4 years ago


my program is running but why it is not giving any output??

no output?? why so?
4 years ago
public static void printEmployee(Employee emp) {


This line showing the error that illegal star of expression???

please help sir

how could I remove this error and make my program run.???
4 years ago
sir I am getting an error in this line


public static void printEmployee(Employee emp) {

the error is illegal start of expression??
4 years ago
4 years ago