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. What is a 'constant specific class body' and where can you use it?






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






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






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






5. How many classes can a class extend?






6. When are class instance variables instantiated?






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






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






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






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






11. What IEEE standard does using strictfp conform to?






12. An ________cannot be static?






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






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






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


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


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






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






19. What are the eight primitive types in Java?






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






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






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






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






24. Local ________ can be marked final






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


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






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






28. How many interfaces can a class implement?


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






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






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






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






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






34. How many arguments can an Enum constructor have?






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






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






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


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


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






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


41. Can a file have no public classes?






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






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


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






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






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






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






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






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






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