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 kinds of exceptions can an overriding method throw that the original does not have?






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






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






4. An instance variable cannot be...






5. An ________ variable cannot be marked strictfp






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






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






8. An interface method cannot be modified as...


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






10. If a class is abstract - do the methods which ares supposed to be abstract too need to be marked 'abstract'?


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






12. How many interfaces can a class implement?


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. Enums can be declared outside a Class - but in...






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






16. What Java version began allowing an Enum type?






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






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. If an Enum has a constructor - can you call that constructor?






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






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






22. What IEEE standard does using strictfp conform to?






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






24. Local ________ can be marked final






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






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






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






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






29. An ________cannot be static?






30. How many classes can a class extend?






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






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






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






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






35. When overriding a method - the return type must be what?


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






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






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






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






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






41. How many arguments can an Enum constructor have?






42. Can a file have no public classes?






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






44. Which of the three non-access modifiers (strictfp - final - abstract) can and can't be used together in a class declaration?


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






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


47. When are class instance variables instantiated?






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






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






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