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 are the rules for checked exceptions in overriding a method?






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


4. Where do var-args have to appear on the method parameter list?






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






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






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


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






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


10. Can an abstract class have a final method?






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






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






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


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






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






16. What are the eight primitive types in Java?






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






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


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






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






21. Enums can be declared...






22. Enums cannot be declared inside...






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






24. An instance variable cannot be...






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






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






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






28. How many classes can a class extend?






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






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






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


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


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






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






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






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






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






38. What modifiers can you use with method parameters?






39. What Java version began allowing an Enum type?






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






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






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






43. Local ________ can be marked final






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


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






46. When are class instance variables instantiated?






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






48. An interface method cannot be...






49. What IEEE standard does using strictfp conform to?






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