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. Is this identifier name valid? Why or why not? int $_myVar;






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






3. What IEEE standard does using strictfp conform to?






4. What Java version began allowing an Enum type?






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






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






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






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






9. Var-args have been possible since what Java version?






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


11. Can an abstract class have a final method?






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






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






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






15. Enums cannot be declared inside...






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






17. Where do var-args have to appear on the method parameter list?






18. Local ________ can be marked final






19. What is the effect of making a method argument final?






20. How many bits does a primitive 'float' hold?






21. How many arguments can an Enum constructor have?






22. How many non public classes can be in any one file?






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






24. 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?






25. 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?


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






27. How many bits does a primitive 'double' hold?






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. What are the eight primitive types in Java?






30. A class is access modified as default. It's methods are access modified as 'public'. What other class files can access the methods in this class?






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


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


33. Which of the three non-access modifiers (strictfp - final - abstract) can and can't be used together in a class declaration?


34. An interface method cannot be...






35. When are class instance variables instantiated?






36. An ________ variable cannot be marked strictfp






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






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






39. What is the proper syntax for declaring a var-arg in a method signature?






40. What modifiers can you use with method parameters?






41. Enums can be declared...






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






43. What is the purpose of an Enum?






44. What is the purpose of making a field 'volatile'?


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






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


47. How many classes can a class extend?






48. Can a subclass see and use inherited 'private' methods and fields?


49. Where in the source code must a 'package' statement be?






50. You cannot _____ a static method