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. Var-args have been possible since what Java version?






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






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






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


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






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






7. What is the purpose of an Enum?






8. An interface method cannot be...






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






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






11. What Java version began allowing an Enum type?






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






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






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






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


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






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






18. Can a file have no public classes?






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






20. Local ________ can be marked final






21. An ________cannot be static?






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






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






24. How many arguments can an Enum constructor have?






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






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


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


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






29. An ________ variable cannot be marked strictfp






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






31. What modifiers can you use with method parameters?






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






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






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






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






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


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






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






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






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






41. Enums can be declared...






42. An instance variable cannot be...






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






44. Enums cannot be declared inside...






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






46. When are class instance variables instantiated?






47. What are the eight primitive types in Java?






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






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






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