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 the purpose of making a class 'abstract'?






2. When are class instance variables instantiated?






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






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






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






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






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


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






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






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






11. An interface method cannot be...






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






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






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






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






16. An instance variable cannot be marked...






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






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


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






20. You cannot _____ a static method






21. An ________cannot be static?






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


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






24. How many interfaces can a class implement?


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






26. Can an abstract class have a final method?






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






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






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


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






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






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


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






34. What is the purpose of an Enum?






35. What are the eight primitive types in Java?






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






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






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






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






40. Enums cannot be declared inside...






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






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






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


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






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






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






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






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






49. What is a 'constant specific class body' and where can you use it?






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