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. When you try to use a method that you don't have access to (due to 'private' etc) - when do you get an error?






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






3. What modifiers can you use with method parameters?






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






5. When are class instance variables instantiated?






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


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






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






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






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






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






12. Enums cannot be declared inside...






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


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






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






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






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


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






19. An instance variable cannot be...






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






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






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






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






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


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






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






27. You cannot _____ a static method






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






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






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


31. What IEEE standard does using strictfp conform to?






32. How many arguments can an Enum constructor have?






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


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






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






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






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






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


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






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


41. How many classes can a class extend?






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






43. What are the eight primitive types in Java?






44. An ________ variable cannot be marked strictfp






45. What Java version began allowing an Enum type?






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






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






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






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






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