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 is the syntax for declaring multiple variables on one line?






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






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






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






5. How many arguments can an Enum constructor have?






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






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






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






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


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


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






12. Can a file have no public classes?






13. An instance variable cannot be marked...






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






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






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


17. What IEEE standard does using strictfp conform to?






18. When are class instance variables instantiated?






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






20. Can an abstract class have a final method?






21. How many bits does a primitive 'float' hold?






22. Local ________ can be marked final






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


24. What modifiers can you use with method parameters?






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






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






27. What Java version began allowing an Enum type?






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






29. What are the eight primitive types in Java?






30. An instance variable cannot be...






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






32. How many interfaces can a class implement?

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


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






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






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






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






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






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






39. Enums cannot be declared inside...






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






41. What is the purpose of an Enum?






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






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


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






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






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






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






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






49. Enums can be declared...






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