Course Hero Logo

How would you instantiate the employee class from a

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 2 - 5 out of 5 pages.

5.How would you instantiate the Employee class from a mainmethod located in another class?public class Employee{private String name;private double salary;public Employee(String n, double s){name = n;salary = s;}}Mark for Review(1) PointsEmployee emp1 = new Employee();Employee emp1 = new Employee(50000);Employee emp1 = new Employee(50000, "Syam");Employee emp1 = new Employee("Syam", 50000); (*)
CorrectCorrect6.An object reference with a null value points to an empty location inmemory.Mark for Review(1) Points
IncorrectIncorrect. Refer to Section 7 Lesson 3.7.Objects are accessed using reference variables. Mark forReview(1) Points
CorrectCorrect8.What is the output of the following code?Mark for Review(1) Points
s1: Welcome!s2: Welcome! (*)s1: Hellos2: Welcome!s1: Hellos2: Hellos1: Welcome!s2: HelloCorrectCorrect9.Java developers don't need to know an objects location inmemory.Mark for Review(1) PointsTrue (*)False
CorrectCorrect10.In this statement, identify the type of the variable s.Student s = new Student();Mark for Review(1) PointsStringStudent (*)null
ClassCorrectCorrect

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 5 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
sono
Tags
Subroutine, Employee object

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture