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. How many bits does a primitive 'double' hold?






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






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






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






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






6. An instance variable cannot be marked...






7. Enums can be declared...






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


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






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






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






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


13. Does an override have to throw all the exceptions of the original method?






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


15. Is this identifier name valid? Why or why not? int $_myVar;






16. For any method to be abstract - what must also be true about the class?






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


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






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






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






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






22. How many interfaces can a class implement?


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






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






25. You cannot _____ a static method






26. An ________cannot be static?






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


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


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






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






31. How many arguments can an Enum constructor have?






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






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






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


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






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






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






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






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






40. What is the purpose of an Enum?






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






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






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






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






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






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






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






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






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






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