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. Can a subclass see and use inherited 'private' methods and fields?


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






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


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






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






6. What is the purpose of an Enum?






7. How many arguments can an Enum constructor have?






8. An instance variable cannot be marked...






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. If a class is abstract - do the methods which ares supposed to be abstract too need to be marked 'abstract'?


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






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






13. What modifiers can you use with method parameters?






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






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






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






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


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






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






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






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






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






23. Enums can be declared...






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






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






26. An instance variable cannot be...






27. An interface method cannot be...






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


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






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






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






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






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






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






35. What are the eight primitive types in Java?






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


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






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






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






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


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






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


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






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






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






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






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






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






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






50. Local ________ can be marked final