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 occurs when a class is marked as 'final'?






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






3. How many classes can a class extend?






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






5. Enums cannot be declared inside...






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


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






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






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






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






11. How many interfaces can a class implement?


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






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






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






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


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






17. Local ________ can be marked final






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






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


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


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






22. Can a file have no public classes?






23. An interface method cannot be modified as...


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






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


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






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






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






29. You cannot _____ a static method






30. When are class instance variables instantiated?






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






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






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






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






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






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






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






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






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






40. An ________ variable cannot be marked strictfp






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






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






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


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






45. What modifiers can you use with method parameters?






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






47. What are the eight primitive types in Java?






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






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






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