Skip to main content

Posts

Showing posts from July, 2017

Section 3 Input/Output Fundamentals Oracle Java Programming

Section 3 Input/Output Fundamentals                 (Answer all questions in this section) 1.            The new Paths class lets you resolve .. (double dot) path notation. True or false? Mark for                 True (*)                 False 2.            The normalize() method removes extraneous elements from a qualified path. True or false?                  True (*)                 False 3.            The Files class lets you check for file properties. True or false?                  True (*)                 False 4.            The read() method lets you read a character at a time. True or false?       Mark for Review                 True (*)                 False 5.            Java 7 requires you create an instance of java.io.File class. True or false? Mark for Review                 True                 False (*) 6.            Prior to Java 7, you write to a file with a call to the BufferedWriter class's write() method. True or

Section 3 Exception and assertion Oracle Java Programming

Section 3 Exception and assertion                 (Answer all questions in this section) 1.            What is the definition of a logic error?    Mark for Review                 Wrong syntax that will be caught at compile time.                 Bugs in code that make your program run different than expected (*)                 Computer malfunction that makes your code run incorrectly.                 Something that causes your computer to crash. 2.            Is this the correct syntax for catching an exception? Try(inputStream = "missingfile.txt"); Catch(exception e); True or false?                  True                 False (*) 3.            Multiple catch statements can be used for a single try statement. True or false?    Mark for Review                 True (*)                 False 4.            When will a finally statement be executed?         Mark for Review                 Only if an exception is thrown.              

Section 3 String processing Oracle Java Programming

Section 3 String processing                 (Answer all questions in this section) 1.            Which of the following are true about parsing a String?   Mark for Review                                                 (Choose all correct answers)                       It is a way of dividing a string into a set of sub-strings. (*)                 It is not possible to parse a string using regular expressions.                 It is possible to use a for loop to parse a string. (*)                 It is possible to use the String.split() method to parse a string. (*) 2.            Which of the following correctly defines a StringBuilder?                 A method that adds characters to a string.                 A class inside the java.util.regex package.                 A class that represents a string-like object. (*)                 There is no such thing as a StringBuilder in Java. 3.            Identify the method, of those listed below, that is not

Section 3 Generics and collection Oracle Java Programming

Section 3 Generics and collection                 (Answer all questions in this section) 1.            A generic class is a type of class that associates one or more non-specific Java types with it. The types are determined when an object of that class is created. True or false?    Mark for Review                 True (*)                 False 2.            Which of the following are true about a Type Interface Diamond?                                                  (Choose all correct answers)                       It allows you to create a generic method as you would an ordinary method, without specifying a type between angle brackets. (*)                 It is represented by the angle brackets <>. (*)                 It is an extension of the Collections class that creates a list.                 It is a keyword in Java that prints a diamond to the console screen.                 None of the above. 3.            Choose the instance where it

Section 3 java class design Oracle Java Programming

Sesction 3 java class design                 (Answer all questions in this section) 1.            An interface and abstract class are different names for the same type of class structure. True or false?     Mark for Review                 True                 False (*) 2.            Modeling classes for a business problem requires understanding the business not Java. True or false?       Mark for Review (1) Points                 True                 False (*) 3.            An immutable class can be subclassed in which of these scenarios?                  The class has public static methods. (*)                 The class has default instance methods.                 The final class doesn't have any methods.                 The class has protected instance methods.                 None of the above. 4.            An immutable method is final. True or false?       Mark for Review                 True (*)                 False 5.      

Section 2 Oracle Java Programming

Section 2 (Answer all questions in this section) 1.            Why is it helpful for new programmers to read pre-written code?              Mark for Review (Choose all correct answers)                       Learn new programming techniques. (*)                 Meet new programmers.                 Understand code written by other programmers.                 It is not helpful to read code written by other programmers. 2.            Reading great code is just as important for a programmer as reading great books is for a writer. True or false?                 True (*)                 False 3.            When an object is able to pass on its state and behaviors to its children, this is called:       Mark for Review                 Isolation                 Encapsulation                 Polymorphism                 Inheritance (*) 4.            In the relationship between two objects, the class that is being inherited from is called the maxi-class.

Section 1 Oracle Java Programming

Section 1 (Answer all questions in this section) 1.            If a class is in a package, the system's CLASSPATH must be altered to access the class. True or false?                 True                 False (*) 2.            How would you make an instance of Car in a class that did import the vehicle package below?                 Car c = new Car(); (*)                 vehicle.Car c=new Car();                 vehicle.Car c=new vehicle.Car();                 vehicle.Car c=new vehicle();                 None of the above 3.            Which of the following are files that must be uploaded to a web server to deploy a java application/applet?                Mark for Review                                                 (Choose all correct answers)                       jar files (*)                 JNLP files (*)                 html files (*)                 .java files                 None of the above 4.            Java Web Start is u