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. How many interfaces can a class implement?


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


3. For any method to be abstract - what must also be true about the class?






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






5. Can a private method be overriden by a subclass?


6. What are the built-in methods for class Object?






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






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






9. What modifiers can you use with method parameters?






10. What is the purpose of making a method 'synchronized'?






11. You cannot _____ a static method






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






13. Enums cannot be declared inside...






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






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






16. 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'?






17. What Java version began allowing an Enum type?






18. What are the eight primitive types in Java?






19. What three non-access modifiers can be used with a class declaration?






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






21. An ________cannot be static?






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






23. An interface method cannot be...






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






25. What are the seven non-access modifiers for methods?






26. How many var-arg's can you have in a method signature?






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






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






29. An instance variable cannot be...






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


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






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






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


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






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






36. All methods in an Interface are what by default?






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






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






39. What is a 'constant specific class body' and where can you use it?






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






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






42. Putting abstract and final in the class declaration will give you a run-time or compile time error?






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


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






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






46. Can an abstract class have a final method?






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


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






49. Local ________ can be marked final






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