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. When would you get an error for a class declaration as follows and why? - protected class Me { }


2. An ________ variable cannot be marked strictfp






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






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






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


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


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






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






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






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






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






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






13. What Java version began allowing an Enum type?






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






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






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






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






18. How many interfaces can a class implement?


19. An ________cannot be static?






20. Can an abstract class have a final method?






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






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






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






24. An instance variable cannot be marked...






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






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






27. Enums cannot be declared inside...






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






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






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






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


32. How many classes can a class extend?






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






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






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






36. You cannot _____ a static method






37. Local ________ can be marked final






38. Can a file have no public classes?






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






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


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






42. All fields in an interface must have what three access & non-access modifiers?






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






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






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






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






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


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






49. What are the eight primitive types in Java?






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