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


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






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


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






5. How many classes can a class extend?






6. An ________ variable cannot be marked strictfp






7. An instance variable cannot be marked...






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






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






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






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






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






13. Local ________ can be marked final






14. How many arguments can an Enum constructor have?






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






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


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






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






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






20. What modifiers can you use with method parameters?






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






22. Enums cannot be declared inside...






23. When are class instance variables instantiated?






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






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






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


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






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






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






30. Can a file have no public classes?






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






32. An ________cannot be static?






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






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


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






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


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






38. An interface method cannot be...






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






40. Can an abstract class have a final method?






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






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






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


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






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






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






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






48. Enums can be declared...






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






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