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. Putting abstract and final in the class declaration will give you a run-time or compile time error?






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






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


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






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






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






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






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






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






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






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






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






13. What are the eight primitive types in Java?






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






15. An ________ variable cannot be marked strictfp






16. Can a file have no public classes?






17. What IEEE standard does using strictfp conform to?






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


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


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






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






22. What is the purpose of an Enum?






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






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






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






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






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






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






29. You cannot _____ a static method






30. Local ________ can be marked final






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






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


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


34. How many interfaces can a class implement?


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


36. What modifiers can you use with method parameters?






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






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






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






40. What Java version began allowing an Enum type?






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






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






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






44. How many classes can a class extend?






45. An ________cannot be static?






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






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


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






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






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