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. The following field is defined in an interface. What do we know about it's access and non-access modifiers? int aNumber = 59;


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






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


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






5. Enums cannot be declared inside...






6. An ________ variable cannot be marked strictfp






7. What Java version began allowing an Enum type?






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






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






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






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






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






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






14. Can an abstract class have a final method?






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






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






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






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






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


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






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


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






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






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


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






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






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






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






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






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






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






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






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






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






35. When are class instance variables instantiated?






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






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






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






39. Local ________ can be marked final






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


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






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






43. An interface method cannot be...






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






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






46. An instance variable cannot be marked...






47. What modifiers can you use with method parameters?






48. You cannot _____ a static method






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






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