Answer A..Even though c is null, greet is a static method. In Java, static methods belong to the class, not instances of the class, so they can be called on the class itself or on a null reference to the class.
c.greet() with empty argument
produce args = String[0]
loop is not executed
Main c = null;
c.greet();
The access to static members is allowed through instances of the class that defines them.
The value of the instance doesn't matter.
it could be null.
A is correct, if line 7 (<span> is not considered) because String ... args generate a empty string by default.so if you no send arguments is an empty array. foreach dont print anything
This section is not available anymore. Please use the main Exam Page.1z0-819 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
mzarif
1 month, 2 weeks agoc47d39c
8 months, 3 weeks agocathDev
1 year agoASPushkin
1 year agod7bb0b2
1 year, 3 months agoSamps
1 year, 3 months agoOmnisumem
1 year, 6 months agoStavok
1 year, 9 months ago