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 must you do when extending an abstract class or implementing any interface?






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






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






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






5. What occurs when a class is marked as 'final'?






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






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






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


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






10. How many arguments can an Enum constructor have?






11. An interface method cannot be...






12. An instance variable cannot be marked...






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






14. What are the only two access modifiers valid for a Class?






15. What IEEE standard does using strictfp conform to?






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






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






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






19. What Java version began allowing an Enum type?






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






21. Local ________ can be marked final






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






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






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






25. An ________ variable cannot be marked strictfp






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






27. An ________cannot be static?






28. Can a file have no public classes?






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


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






31. What is the purpose of an Enum?






32. When are class instance variables instantiated?






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






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






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






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






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






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


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






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






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






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






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






44. An instance variable cannot be...






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






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


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






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






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


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