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;
Answers were Sorted based on User's Feedback
Answer / manikandan [ gtec,vellore ]
Answer is d)Nav.Direction d = Nav.Direction.NORTH;
explanation:
enum is specified inside a class Nav and that can b called
from other class that so v use the reference of the class
Nav.it's jus shows Encapsulation concept
Is This Answer Correct ? | 8 Yes | 3 No |
What is the difference between the Reader/Writer class hierarchy and the InputStream/OutputStream class hierarchy?
what is heap memory?
0 Answers Tavant Technologies, Zensar,
what is platform dependent translation and platform dependent programming language
Difference between current previous versions of Java?
What is stack explain?
What are locale settings?
Write a java program to check if a number is prime or not?
What do you mean by buffering?
What occurs when an object is constructed?
What is hypertext?
What are keywords give examples?
Differentiate between array list and vector in java.