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. An ________cannot be static?






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






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


4. An ________ variable cannot be marked strictfp






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






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


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






8. What Java version began allowing an Enum type?






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


10. Local ________ can be marked final






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






12. How many public classes can be defined in one source code file?






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






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






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






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






17. You cannot _____ a static method






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






19. Can a file have no public classes?






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






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






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






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






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






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






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






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


28. An instance variable cannot be marked...






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






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






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


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






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






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


35. Can an abstract class have a final method?






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






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






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






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






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


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






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






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






44. An interface method cannot be...






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






46. When are class instance variables instantiated?






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


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


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






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