Test your basic knowledge |

Oracle Sun Certified Java Programmer

Instructions:
  • Answer 50 questions in 15 minutes.
  • If you are not ready to take this test, you can study here.
  • Match each statement with the correct term.
  • Don't refresh. All questions and answers are randomly picked and ordered every time you load a test.

This is a study tool. The 3 wrong answers for each question are randomly chosen from answers to other questions. So, you might find at times the answers obvious, but you will see it re-enforces your understanding as you take the test each time.
1. Can a subclass see and use inherited 'private' methods and fields?


2. Calling what method will return an Array of Enum values?






3. What is the purpose of an Enum?






4. An interface cannot extend any extendable (non-final) class - can only...






5. You cannot _____ a static method






6. When would you get an error for a class declaration as follows and why? - protected class Me { }


7. How many arguments can an Enum constructor have?






8. What kinds of exceptions can an overriding method throw that the original does not have?






9. When overriding a method - the return type must be what?


10. How many public classes can be defined in one source code file?






11. When overriding a method - the argument list (i.e. signature) must be what?






12. Can you make an overriding method more access restrictive (public to private) or less restrictive (private to public)?






13. Does an override have to throw all the exceptions of the original method?






14. All fields in an interface must have what three access & non-access modifiers?






15. An original method that will be overriden by a class in the same package as the original could have what access levels and still be considered an 'override'?






16. Once a reference variable is defined - can it's object type be changed?






17. What must you do when extending an abstract class or implementing any interface?






18. What is the purpose of making a method 'native'?






19. An interface method cannot be modified as...


20. What kind of error (run-time or compile) do you get when trying to extend a final class?






21. Can an abstract class have a final method?






22. Is this identifier name valid? Why or why not? int 34myVar-Yes;






23. Can a file have no public classes?






24. What Java version began allowing an Enum type?






25. An interface method cannot be...






26. Is this identifier name valid? Why or why not? int $_myVar;






27. Do Enums have to be within an existing class?






28. An original method that will be overriden by a class not in the same package as the original could have what access levels and still be considered an 'override'?






29. An ________cannot be static?






30. Where can the brackets for an array declaration go?






31. What is the code format for an abstract method?






32. What is the purpose of making a class 'abstract'?






33. What modifiers can you use with method parameters?






34. The following field is defined in an interface. What do we know about it's access and non-access modifiers? int aNumber = 59;


35. How many classes can a class extend?






36. What occurs when a class is marked as 'final'?






37. What are the rules for checked exceptions in overriding a method?






38. What is the length in bytes of type 'int' - and what is it's maximum size?






39. What are the only two access modifiers valid for a Class?






40. What is the length in bytes of type 'long' - and what is it's maximum size?






41. How many interfaces can a class implement?


42. An instance variable cannot be marked...






43. What access level does the following interface method have? void getSomething(); public.


44. If an Enum has a constructor - can you call that constructor?






45. What is the most basic construction for an Enum?






46. Enums can be declared...






47. When accessing an object you really don't have access to (it's 'private' or 'default' in another package - etc) - when will you get an error: at compilation or at run-time?


48. A reference variable can be reassigned to another object that is of the same type. It can also be reassigned to a supertype or subtype of the original type?






49. Can multiple non-primitive variables be defined in one line?






50. What is the basic construction for calling an Enum value?