Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


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



10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Spri..

Answer / neil

Nav.Direction d = Nav.Direction.NORTH;

Is This Answer Correct ?    24 Yes 1 No

10. class Nav{ 11. public enum Direction { NORTH, SOUTH, EAST, WEST } 12. } 13. public class Spri..

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 ?    7 Yes 3 No

Post New Answer

More Core Java Interview Questions

what is the output??????? public class multireturn { public(int assign x ( int x) { if(4==x) { return 7; } else if (7=x+3) { return 6; } return 5; } }

3 Answers   TCS,


what is meant by HQL?

0 Answers   Cap Gemini,


How are observer and observable used in java programming?

0 Answers  


What is args length in java?

0 Answers  


i need source code for income tax program using java inheritance

1 Answers  






Static Variable can referred in non-static method?

3 Answers  


What is the difference between array and arraylist? what is the difference between arraylist and linkedlist?

8 Answers   EDS, Matrix,


What is arraylist e in java?

0 Answers  


how can we synchronize Hash map?

3 Answers   CTS,


What are advantages and disadvantages of OOPs?

0 Answers   Amdocs,


What are java packages? What's the significance of packages?

0 Answers  


Why do we need autoboxing in java?

0 Answers  






Categories