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. Can a file have no public classes?






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






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






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






5. What modifiers can you use with method parameters?






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






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






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


9. When are class instance variables instantiated?






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






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






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






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






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


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






16. Enums can be declared...






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






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


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


20. Enums cannot be declared inside...






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






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


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






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






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






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






27. What is the purpose of an Enum?






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






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






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






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






32. An instance variable cannot be...






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






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






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






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






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


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






39. How many classes can a class extend?






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






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






42. Var-args have been possible since what Java version?






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






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






45. An ________cannot be static?






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






47. An ________ variable cannot be marked strictfp






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






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






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