1. The keyword that is used to create an object variable in memory is: A. public B. int C. new D. Class 2. An object is a(n) A. blueprint B. instance of some class C. variable D. cookie cutter 3. This...




1. The keyword that is used to create an object variable in memory is: A. public B. int C. new D. Class 2. An object is a(n) A. blueprint B. instance of some class C. variable D. cookie cutter 3. This is a method that return the value of a class's fieldA. accessor B. constructor C. void D. mutator4. When the value of an item is dependent on other data, and that item is no t updated when the other data is changed, what has the value become? A. bitter B. moldy C. asynchronous D. stale 5. To prevent other classes from accessing a class's field (i.e., data member) at all, which of the following access specifier should be use d? A. private B. public C. protected D. Do not use any access specifier 6. If you provide any constructor for a class, Java compiler will no longer provide the default no - Arg constructor. Is this statement true or false? A. True B. False 7. Read the following piece of code public class Demo { public void demo (String param) { ...; } public int demo (int param) {...;}}The demo methods in the class Demo are an example of overloading. Is this statement correct? A. True B. False8. A static method cannot access instance fields of a class. Is this statement true or false?A. true B. false9. We have class Demo defined as follows:public class Demo {public static int counter = 0;public int increase() { return counter++;}}Now we have the following two statements in the main method that use the increase method as follows: System.Out.print (Demo.increase()); System.out.println(Demo. Increase ()); The output will be: A. 0 0 B. 1 1 C. 1 2 D. 0 1 E. error 10. Each object (instance) of a class has its own set of fields (member variables).A. true B. false11. When an object is passed as an argument to a method, this is actually passed.A. a copy of the object C. the name of the objectB. a reference to the object D. none of these; you cannot pass an object12. Assume that we want to define h1 as a House object, as defined in our CYBR150 class, thestatement to create the h1 object is:A. h1 = new House();B. House h1 = new House;C. House h1 = new House();D. newHouse = h1;E. none of the above.13. Find and fix the error(s)and write two appropriate accessor methods and two appropriateconstructorspublic class MyClass {private int x;private double y;public static void setValues(int a, double b) {x=a;y=b;}I really appreciate if you put some description.


May 19, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here