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






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






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






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






5. What IEEE standard does using strictfp conform to?






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






7. When are class instance variables instantiated?






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






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






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


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. You cannot _____ a static method






13. An ________ variable cannot be marked strictfp






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






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






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






17. An ________cannot be static?






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






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






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






21. Enums can be declared...






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






23. Can an abstract class have a final method?






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






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






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. What is the basic construction for calling an Enum value?






28. What Java version began allowing an Enum type?






29. What is the purpose of an Enum?






30. Can a file have no public classes?






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






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






33. An instance variable cannot be marked...






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


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


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






37. Where do var-args have to appear on the method parameter list?






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






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






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






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






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






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






44. Enums cannot be declared inside...






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


46. What modifiers can you use with method parameters?






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






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






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






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