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 are class instance variables instantiated?






2. An instance variable cannot be...






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






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






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






6. An instance variable cannot be marked...






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






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






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






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






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






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






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






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


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






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


17. How many interfaces can a class implement?


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






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






20. An ________ variable cannot be marked strictfp






21. Enums cannot be declared inside...






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


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


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






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






26. Can a file have no public classes?






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


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






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


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






31. What IEEE standard does using strictfp conform to?






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






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






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






35. What is the purpose of an Enum?






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






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






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






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






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


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






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






43. Can an abstract class have a final method?






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






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


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


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






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






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






50. How many arguments can an Enum constructor have?