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. What occurs when a class is marked as 'final'?






2. An instance variable cannot be...






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


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






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






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






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






8. What IEEE standard does using strictfp conform to?






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






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


11. An interface method cannot be...






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






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






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






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






16. What is the purpose of an Enum?






17. An ________ variable cannot be marked strictfp






18. Local ________ can be marked final






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






20. An instance variable cannot be marked...






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






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






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


24. How many classes can a class extend?






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






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






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






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






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


30. What modifiers can you use with method parameters?






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






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






33. What Java version began allowing an Enum type?






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






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






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






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






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






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


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






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


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






43. Where in the source code must a 'package' statement be?






44. When are class instance variables instantiated?






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






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


47. Enums cannot be declared inside...






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






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