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 are the only two access modifiers valid for a Class?






2. What IEEE standard does using strictfp conform to?






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






4. Can an abstract class have a final method?






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


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






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


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






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






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


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. Local ________ can be marked final






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






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






15. You cannot _____ a static method






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 public classes can be defined in one source code file?






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






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






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






22. How many interfaces can a class implement?


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


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






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






26. How many arguments can an Enum constructor have?






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






28. When are class instance variables instantiated?






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






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






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






32. Can a subclass see and use inherited 'private' methods and fields?


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






34. What is the purpose of making a method 'synchronized'?






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






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






37. An interface method cannot be...






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






39. How many classes can a class extend?






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






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






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






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


44. What modifiers can you use with method parameters?






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






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






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






48. Enums can be declared...






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






50. What Java version began allowing an Enum type?