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 are the only two access modifiers valid for a Class?






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


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






4. What IEEE standard does using strictfp conform to?






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






6. What Java version began allowing an Enum type?






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






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






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






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. What is the purpose of an Enum?






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


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






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


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






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






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


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






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






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






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


22. Can a file have no public classes?






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


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






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






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






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






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






29. Local ________ can be marked final






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


31. An ________cannot be static?






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






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






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






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






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






37. An ________ variable cannot be marked strictfp






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






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






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






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






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






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






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


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






46. An instance variable cannot be...






47. You cannot _____ a static method






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






49. Can an abstract class have a final method?






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