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 is the proper syntax for declaring a var-arg in a method signature?






2. An ________ variable cannot be marked strictfp






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






4. You cannot _____ a static method






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






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






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


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






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






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






11. How many classes can a class extend?






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


13. What IEEE standard does using strictfp conform to?






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






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






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






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






18. Local ________ can be marked final






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






20. How many interfaces can a class implement?


21. When are class instance variables instantiated?






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






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






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






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






26. What modifiers can you use with method parameters?






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






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






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






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






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






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






33. Enums can be declared...






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






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






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


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






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






39. Enums cannot be declared inside...






40. Can a file have no public classes?






41. What Java version began allowing an Enum type?






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






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






44. What is the purpose of an Enum?






45. Can an abstract class have a final method?






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






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






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






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


50. How many arguments can an Enum constructor have?