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 classes can a class extend?






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






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






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






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


6. Is this identifier name valid? Why or why not? int 34myVar-Yes;






7. An instance variable cannot be...






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






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 arguments can an Enum constructor have?






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






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


13. An ________ variable cannot be marked strictfp






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






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






16. Can an abstract class have a final method?






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


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






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






20. How many interfaces can a class implement?


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






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






23. What IEEE standard does using strictfp conform to?






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


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






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






27. Local ________ can be marked final






28. Can a file have no public classes?






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






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






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






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






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






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






35. Enums can be declared...






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


37. An instance variable cannot be marked...






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






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






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






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






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






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






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






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






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






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


48. Enums cannot be declared inside...






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






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