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 you try to use a method that you don't have access to (due to 'private' etc) - when do you get an error?






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






3. An interface method cannot be...






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






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






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






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






8. An ________cannot be static?






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






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


11. Local ________ can be marked final






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






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






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






15. An instance variable cannot be marked...






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






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






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






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






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






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






23. How many classes can a class extend?






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






25. How many arguments can an Enum constructor have?






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






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






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


29. An instance variable cannot be...






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






31. What is the purpose of an Enum?






32. Enums cannot be declared inside...






33. Can a file have no public classes?






34. What modifiers can you use with method parameters?






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






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






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






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






39. What Java version began allowing an Enum type?






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






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






42. You cannot _____ a static method






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






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






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


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






47. When are class instance variables instantiated?






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






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






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