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 arguments can an Enum constructor have?






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






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






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


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






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






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






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


9. Enums cannot be declared inside...






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






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






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






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






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






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






16. When are class instance variables instantiated?






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






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






19. An interface method cannot be...






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


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






22. Can a file have no public classes?






23. Local ________ can be marked final






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


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


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






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






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






29. An instance variable cannot be...






30. What are the eight primitive types in Java?






31. What Java version began allowing an Enum type?






32. What is the purpose of an Enum?






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






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






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






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






37. What IEEE standard does using strictfp conform to?






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






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






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






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






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






43. How many classes can a class extend?






44. What modifiers can you use with method parameters?






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






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






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






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






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






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