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 are synchronized methods and synchronized statements in java programming?
Relationship between an event-listener interface and an event-adapter class?
How do you insert a line break?
explain Anonynous inner class?
We are seeing so many videos/audios as many web sited. But question is these videos or audios are stored in Databases ( Oracle, Mysql, Sybase,... ) or stored any file directory from there they will give the link for that? Pls explain and give sample code to achieve this one? Thanks, Seenu.
How do you represent a space in regex java?
whays is mean by inner class?
What loop means?
What is an exception in java?
When we can access the static data member without creating the object what is the need of the object in java.
5 Answers Airhub, ssinformatics,
What are the advantages of the model over the event- inheritance model?
What are the Abstract Classes provided by Java?