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. The following field is defined in an interface. What do we know about it's access and non-access modifiers? int aNumber = 59;


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






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






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






5. What is the purpose of an Enum?






6. If a class is abstract - do the methods which ares supposed to be abstract too need to be marked 'abstract'?


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






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






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






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






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






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






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






14. An instance variable cannot be...






15. Enums can be declared outside a Class - but in...






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






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






18. At what point will you get an error if an interface method is 'protected' or 'private'?






19. What Java version began allowing an Enum type?






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






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






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


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






24. How many classes can a class extend?






25. An interface method cannot be...






26. How many arguments can an Enum constructor have?






27. Local ________ can be marked final






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






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






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


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


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


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






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






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






36. What is the syntax for declaring multiple variables on one line?






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






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






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






40. An ________cannot be static?






41. Enums cannot be declared inside...






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






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






44. Enums can be declared...






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






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






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






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






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


50. When you try to use a method that you don't have access to (due to 'private' etc) - when do you get an error?