Examlex

Solved

Which of the Following Class Definitions Is Correct in Java

question 13

Multiple Choice

Which of the following class definitions is correct in Java? (i) public class Employee {private String name; private double salary; private int id; public Employee() {name = ""; salary = 0.0; id = 0;} public Employee(String n, double s, int i) {name = n; salary = s; id = i;} public void print() {System.out.println(name + " " + id + " " + salary) ;}} (ii) public class Employee {private String name; private double salary; private int id; public void Employee() {name = ""; salary = 0.0; id = 0;} public void Employee(String n, double s, int i) {name = n; salary = s; id = i;} public void print() {System.out.println(name + " " + id + " " + salary) ;}}


Definitions:

Ligaments

Tough, fibrous tissues that connect bones to other bones, providing stability and support in joints.

Voluntary

Actions or movements that are under conscious control, typically referring to muscle movements initiated by individual choice.

Involuntary

Actions or processes within the body not under conscious control, such as the heartbeat or digestive movements.

Adipose Tissue

A type of body tissue containing stored fat, used for energy storage, insulation, and cushioning of organs.

Related Questions