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. If a class's public class declaration is something like - 'public class HiThereSally {' - what must the source code file be named? Why?






2. What are the eight primitive types in Java?






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






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 kinds of exceptions can an overriding method throw that the original does not have?






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


7. Can you make an overriding method more access restrictive (public to private) or less restrictive (private to public)?






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






9. How many arguments can an Enum constructor have?






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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






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






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






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






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






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






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






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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






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






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






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






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






29. What modifiers can you use with method parameters?






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






31. Enums can be declared...






32. Can an abstract class have a final method?






33. You cannot _____ a static method






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






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






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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






39. What Java version began allowing an Enum type?






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






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






42. An instance variable cannot be marked...






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


44. An ________cannot be static?






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






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






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

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183


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






50. Local ________ can be marked final