Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Post New Answer

More Core Java Interview Questions

How would you convert bytes to string?

0 Answers  


What about anonymous inner classes in java?

0 Answers  


how many types of Inheritance?

0 Answers   Impetus,


Can you access the private method from outside the class?

0 Answers  


system.out.println(1 + 3);

8 Answers  


What are the 2 types of java programs?

0 Answers  


What is the purpose of the File class?

3 Answers  


How to find the length and capacity of a string buffer ?

2 Answers  


What is a flag value?

0 Answers  


What is singleton pattern?

0 Answers  


What is the properties class in java programming?

0 Answers  


What is == in java?

0 Answers  


Categories