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. Var-args have been possible since what Java version?






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






3. 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


4. An interface method cannot be...






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






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






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






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


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






10. An instance variable cannot be marked...






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


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






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






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






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






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






17. How many classes can a class extend?






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






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






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






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






22. What are the eight primitive types in Java?






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






24. Local ________ can be marked final






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






26. Can a file have no public classes?






27. Enums can be declared...






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






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

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


30. What IEEE standard does using strictfp conform to?






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






32. 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


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






34. What modifiers can you use with method parameters?






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






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






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


38. What is the purpose of an Enum?






39. 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


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






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






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






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






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






45. Can an abstract class have a final method?






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






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






48. Enums cannot be declared inside...






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






50. When are class instance variables instantiated?