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


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






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






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






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






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






7. An ________cannot be static?






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






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






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






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






12. An instance variable cannot be...






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






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






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






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






17. What IEEE standard does using strictfp conform to?






18. A class is access modified as default. It's methods are access modified as 'public'. What other class files can access the methods in this class?






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


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






21. Enums cannot be declared inside...






22. When are class instance variables instantiated?






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






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






25. What is the purpose of making a field 'transient'?






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






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


28. What modifiers can you use with method parameters?






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






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






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


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






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






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






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






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






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






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






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






40. How many classes can a class extend?






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






42. Can an abstract class have a final method?






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

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


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






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






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






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






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






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






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