PrepAway - Latest Free Exam Questions & Answers

Which Java statement checks the status of an attribute called trafficLight?

Consider the definition of the code table item in the following extract from TrafficLights.ctx:

Which Java statement checks the status of an attribute called trafficLight?

A. if (trafficLight.equals(curam.codetable.TRAFFICLIGHTS.GO)) {

B. if (trafficLight.equals(curam.codetable.TRAFFICLIGHTS.TL1)) {
C. if (trafficLight.equals(curam.codetable.TRAFFICLIGHTS.GREEN)) {
D. if (trafficLight.equals(“Green”)) {


Leave a Reply