Tested. Answer is B.
Source code:
public class Planet {
public String name;
public int moons;
public Planet (String name, int moons) {
this.name = name;
this.moons = moons;
}
public static void main(String[] args) {
Planet[] planets = {
new Planet("Mercury",0),
new Planet("Venus",0),
new Planet("Earth",1),
new Planet("Mars",2)
};
System.out.println(planets);
System.out.println(planets[2].name);
System.out.println(planets[2].moons);
}
}
Correct is Letter B, because in the first line return with hash, but in the second and third line the object is called in the position directly, now return:
Planets.Planet;hash
Earth
1
This section is not available anymore. Please use the main Exam Page.1z0-808 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.
MPignaProTech
8 months agodiptimayee
8 months, 2 weeks agoMPignaProTech
8 months, 2 weeks agogu_esposar
1 year, 3 months agomesonjesi
1 year, 7 months agofvelazqueznava
1 year, 8 months agoKolodets
2 years, 2 months agoVicky_65
2 years, 2 months agotawa_z58
2 years, 5 months agohaisaco
2 years, 6 months agoakbiyik
2 years, 7 months agomorgan3987
2 years, 7 months agocarloswork
2 years, 8 months agokkaayyyy
2 years, 8 months agoiSnover
2 years, 9 months agoshivkumarx
2 years, 9 months agoshivkumarx
2 years, 9 months ago