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. How many arguments can an Enum constructor have?






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






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






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






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


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






7. How many interfaces can a class implement?


8. Can an abstract class have a final method?






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






10. An instance variable cannot be marked...






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






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


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






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






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






16. What modifiers can you use with method parameters?






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






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






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


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






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






22. What Java version began allowing an Enum type?






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


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






25. When are class instance variables instantiated?






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






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






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






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


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






31. Can a file have no public classes?






32. What is the purpose of an Enum?






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






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






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






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






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






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






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






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






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






42. How many classes can a class extend?






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


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






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






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


47. Enums can be declared...






48. An instance variable cannot be...






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






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