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 overriding a method - the argument list (i.e. signature) must be what?






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






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






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


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






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






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






8. What modifiers can you use with method parameters?






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






10. An interface method cannot be...






11. What IEEE standard does using strictfp conform to?






12. An ________ variable cannot be marked strictfp






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






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






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






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






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






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






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






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






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






22. You cannot _____ a static method






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


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


25. Can an abstract class have a final method?






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






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






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






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






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






31. How many classes can a class extend?






32. Does an override have to throw all the exceptions of the original method?






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






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


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






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






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






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






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


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






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






42. Local ________ can be marked final






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


44. What are the eight primitive types in Java?






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






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


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






48. How many arguments can an Enum constructor have?






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


50. When accessing an object you really don't have access to (it's 'private' or 'default' in another package - etc) - when will you get an error: at compilation or at run-time?

Warning: Invalid argument supplied for foreach() in /var/www/html/basicversity.com/show_quiz.php on line 183