please help p section 1 multiple choice questions 30 points 2 points each choose onl 5153025
please help!
p . Section 1. Multiple choice questions (30 points, 2 points each) Choose only one alternative out of suggested answers. Each correct answer is worth otherwise 1) What Java class is used to write out data to a text file? A) Scanner B) URL C ) PrinlWriter D) Filo 2) What Java class is used to read data from a text file? A Scanner B) URL. C) Print Writer D) File 3) What Java class is used to identify the name and the path of a text file? A) Scanner B) URL C ) Print Writer D) File 4) What Java class is used to represent a Uniform Resource Locator, a pointer to a resource on the World Wide Web? A) Scanner B) URL C ) Print Writer D) File 4 5) 5) There are 3 clauses for Java's Exception handling mechanism. The code which can cause the exception should be placed in which clause? A) try B) catch C) finally D) throws 6) The code which must be executed no matter if the exception occurred should be placed in which clause? A) try B) catch C) finally D) throws 7) The code that will be executed if exception occurred should be placed in which clause? A) try B) catch C) finally D) throws 8) Java does not mandate you to write code to catch _exceptions. A) checked B) unchecked C) A&B D) neither A nor B B) 9) If you are reading from an existing file in your program, what particular type of Exception you need to take care of? A) NullPointerException B) RuntimeException C) FileNotFoundException D) StringindexOutOlBounds Exception 9) 10) 10) Which Java keyword is used to define a subclass? A) super B) extends C) implements D) override 11) Which Java keyword is used to declare a variable shared by all objects of a ass? A) protected B) public C) private D) static 11) subclass? 12) Which Java keyword is used to cal a superclass's constructor from a A) new B) this C) super D) constructor D) constructor A) new 13) Objects are created using what method? B) this C) super 14) Which of the following files is not a binary file? A) Testbin B) Test.exe C) Test.class D) Test.java 15) Advantages of using binary classes include: A) Non-readable by humans B) more efficient to process C) does not require conversions D) all of the above Section 2. Abstract classes and Interfaces. True/False (20 points, 2 points each) A. An Abstract class can contain abstract and non-abstract methods B. You can create an object from an abstract class C. Abstract classes can have constructors D. Abstract classes can have methods with bodies_ E. Abstract classes can have instance variables F. An interface can contain abstract and non-abstract methods G. You can create an object from an interface H. Interfaces can have constructors 1 Interfaces can have methods with bodies J. Interfaces can have instance variables Section 3. Recursion (20 points) Which of the following statements is false? (5 points) A Every recursive method must have a base case or a stopping condition. Without it, infinite recursion occurs and causes this type of exception stackoverflowerror, B. Every recursive call reduces the original problem, bringing it increasingly closer to a base case until it becomes that case. C. Infinite recursion can occur if recursion does not reduce the problem in a manner that allows it to eventually converge into the base case. D. Every recursive method must have a return value. any eh line number of the program below defines the base (5 points) out (10 grinta, Trace the recursive call, mystery(3,6) and show the printed 1 public class Test 20 3 public static void main(String [] args) 4 ( 5 System.out.println( mystery(3,6)); 7 public static int mystery(int a, int b) 6 8 10 11 if (a=-1) return b; else return b + mystery(a-1, b); 12 13 14) Output: Trace (use space provided on blank page, if needed): generis (30 points) inge s 1 (10 points). An Inheritance hierarchy is used in a system win mory. The bract Employee class is the super class. An Employees have an at ass, Employee with the following requirements T h e instance variables: ID integer) and name (String) By A constructor that receives the ID and name as parameters. Accessor and mutation methods for ID and name. An abstract method get Salary that returns a double. 6) Attring method which returns a String that includes the ID and name of the employee