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 modifiers can you use with method parameters?






2. An instance variable cannot be...






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. What is the length in bytes of type 'int' - and what is it's maximum size?






5. How many arguments can an Enum constructor have?






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






7. What is the purpose of an Enum?






8. An ________cannot be static?






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






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






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






12. How many classes can a class extend?






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






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






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






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






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






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






19. Enums can be declared...






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






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






22. Can you make an overriding method more access restrictive (public to private) or less restrictive (private to public)?






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






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






25. You cannot _____ a static method






26. What is the effect of making a method argument final?






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


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






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


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


31. Can an abstract class have a final method?






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


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






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






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






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






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






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






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






40. What is the syntax for declaring multiple variables on one line?






41. What are the eight primitive types in Java?






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






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






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






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. What occurs when a class is marked as 'final'?






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






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






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






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