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 modifiers can you use with method parameters?






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






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






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


5. An instance variable cannot be marked...






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






7. How many interfaces can a class implement?


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






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






10. An ________ variable cannot be marked strictfp






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






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






13. How many arguments can an Enum constructor have?






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






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


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






17. Enums can be declared...






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






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






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


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


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






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


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






25. How many classes can a class extend?






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






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






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






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






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


31. An instance variable cannot be...






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






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






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






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






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


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






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






39. Can an abstract class have a final method?






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






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






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


43. Local ________ can be marked final






44. Can a file have no public classes?






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






46. An ________cannot be static?






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






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






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






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