Course Hero Logo

Which two are access modifiers mark for review 1

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 3 - 5 out of 9 pages.

7.Which two are access modifiers?Mark for Review(1) Points(Choose all correct answers)public (*)finalprivate (*)static
CorrectCorrect8.An object reference directs you from one object to another.Mark for Review(1) PointsTrue (*)FalseIncorrectIncorrect. Refer to Section 7 Lesson 5.9.Which two statements are true about getter methods?Mark forReview(1) Points
CorrectCorrect10.Access and visibility of a class should be limited as much aspossible.Mark for Review(1) Points
CorrectCorrect11.What is encapsulation?Mark for Review(1) Points
CorrectCorrect12.Given the following code, why does your IDE complain thatnon-static variable name cannot be referenced from a static context?public class Employee{public static int employeeID;public String name;public static void display(){System.out.println(employeeID);System.out.println(name);}}Mark for Review(1) PointsStatic variables cannot be referenced from methods.It would be possible to call the display() method and attempt to referencean objects name before any object exists. (*)The variable name has a null value.Static variables are only accessible from instance methods.
CorrectCorrect

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 9 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
sono
Tags
Subroutine

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture