10. class Nav{
11. public enum Direction { NORTH, SOUTH, EAST, WEST }
12. }
13. public class Sprite{
14. // insert code here
15. }
Which code, inserted at line 14, allows the Sprite class to
compile?
a)Direction d = NORTH;
b)Nav.Direction d = NORTH;
c)Direction d = Direction.NORTH;
d)Nav.Direction d = Nav.Direction.NORTH;

Answer Posted / neil

Nav.Direction d = Nav.Direction.NORTH;

Is This Answer Correct ?    33 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is nested interface?

518


Can you inherit a constructor java?

569


What is map and hashmap in java?

615


What is a subsequence of a string?

541


What are the methods available in a class?

583






What is gc()?

577


Explain the difference between throw and throws in java?

543


What's the base class of all exception classes?

562


Will the compiler creates a default constructor if I have a parameterized constructor in the class?

579


What about static nested classes in java?

586


What are wrapper classes in java?

594


What are the different http methods?

527


What are the types of methodology?

507


Tell me how many ways are there to initialise an integer with a constant.

637


Can we create a constructor in abstract class?

567