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 method 'synchronized'?






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






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






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






5. What is the purpose of making a class 'abstract'?






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


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






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


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






10. An instance variable cannot be...






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


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






13. Can a file have no public classes?






14. How many classes can a class extend?






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






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


17. Local ________ can be marked final






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






19. Enums cannot be declared inside...






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






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






22. How many interfaces can a class implement?


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






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






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






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


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






28. What modifiers can you use with method parameters?






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


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






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






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






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






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






35. You cannot _____ a static method






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






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






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






39. An interface method cannot be...






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






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






42. Can an abstract class have a final method?






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






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


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






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






47. How many arguments can an Enum constructor have?






48. When are class instance variables instantiated?






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






50. An ________cannot be static?