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. Is this identifier name valid? Why or why not? int 34myVar-Yes;






3. What are the eight primitive types in Java?






4. Enums cannot be declared inside...






5. How many classes can a class extend?






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






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






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






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






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






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


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






13. An ________cannot be static?






14. When are class instance variables instantiated?






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






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


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






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






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






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






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






22. What IEEE standard does using strictfp conform to?






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






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






25. An instance variable cannot be marked...






26. How many arguments can an Enum constructor have?






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






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






29. Enums can be declared...






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


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






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


33. Can a file have no public classes?






34. Can an abstract class have a final method?






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






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






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






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






39. An interface method cannot be...






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






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






42. What Java version began allowing an Enum type?






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






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






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






46. Local ________ can be marked final






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






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






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






50. An instance variable cannot be...