Is there any error in the following code? If yes, identify the error.

EmployeeMgmt constructor: public int EmployeeMgmt() { emp_id = 100; }

Options
- Return type
- No errors
- Formal parameters
- Name


CORRECT ANSWER : Return type

Discussion Board
This question is wrong.

There are multiple errors.
- public must be lowercase
- there needs to be () after the constructor name but before the curly braces
- there cannot be a return type.

Matthew 04-26-2016 02:46 PM

Case sensitive!

"Public" must be lowercase! There are two errors in that line.

Andrew 06-22-2015 01:26 PM

.net

really i like this test for best perpration

akhilesh singh 02-24-2015 12:57 PM

EmployeeMgmt Constructor

constructor can not have return type

Satish Javiya 11-13-2014 05:36 AM

EmployeeMgmt Constructor

Answer is
Public EmployeeMgmt(){emp_id=100;}

Chandan Kumar Rath 12-23-2013 12:08 PM

Write your comments

 
   
 
 

Enter the code shown above:
 
(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement