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. Calling what method will return an Array of Enum values?






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






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


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


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






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






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






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






9. What is the purpose of making a field 'transient'?






10. What Java version began allowing an Enum type?






11. An instance variable cannot be marked...






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






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






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






15. An ________ variable cannot be marked strictfp






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






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


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






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






20. Can a file have no public classes?






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






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






23. When are class instance variables instantiated?






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






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


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






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






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






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






30. How many classes can a class extend?






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






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






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






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


35. An ________cannot be static?






36. Enums can be declared...






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






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


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






40. Local ________ can be marked final






41. What is the purpose of an Enum?






42. What modifiers can you use with method parameters?






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






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






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


46. Enums cannot be declared inside...






47. If a class's public class declaration is something like - 'public class HiThereSally {' - what must the source code file be named? Why?






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






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






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