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 interfaces can a class implement?


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






3. Enums cannot be declared inside...






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






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






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






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






8. What modifiers can you use with method parameters?






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






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 is the purpose of an Enum?






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






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






14. Can a file have no public classes?






15. How many arguments can an Enum constructor have?






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






17. How many classes can a class extend?






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


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






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






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






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






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






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


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






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






27. Can an abstract class have a final method?






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






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






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






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


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






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






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






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


36. Enums can be declared...






37. You cannot _____ a static method






38. An ________cannot be static?






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






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






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






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


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


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






45. What are the eight primitive types in Java?






46. An instance variable cannot be...






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


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






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






50. What IEEE standard does using strictfp conform to?