java class QUESTION 1 A derived class is also called a sub
java class : QUESTION 1 A derived class is also called a sub class super class base class all of the above 2 points Save Answer QUESTION 2 The correct syntax for passing an array as an argument in a method is: a[] a a() a[0]..a[a.length] 2 points Save Answer QUESTION 3 A _________ can occur if a programmer allows an accessor method to return a reference to an array instance variable. short circuit privacy leak partially filled array syntax error 2 points Save Answer QUESTION 4 A ___________ statement terminates the current iteration of a loop. break continue switch assert 2 points Save Answer QUESTION 5 A method or instance variable modified by protected: can not be accessed by name inside its own class definitions. can not be accessed by name inside any class derived from it. can not be accessed by name in the definition of any class in the same package. can not be accessed by name in any other class (that is, other than classes named in a-c.). 2 points Save Answer QUESTION 6 Converting from a value of primitive type to a corresponding object of its associated wrapper class is called: Boxing Unboxing Converting Reinstantiating 2 points Save Answer QUESTION 7 In Java, source code is compiled into object code called ______________. Class code Bit-code Method code Byte-code 2 points Save Answer QUESTION 8 In the definition of a class, the public method that can change the data in the object of the class is called a/an: mutator accessor modifier none of the above 2 points Save Answer QUESTION 9 The class __________ is an ancestor class of all Java classes. String Object Math Scanner 2 points Save Answer QUESTION 10 The name of a method and the list of ________ types in the heading of the method definition is called the method signature. parameter argument return primitive 2 points Save Answer QUESTION 11 The new operator: allocates memory is used to create an object of a class associates an object with a variable that names it. All of the above. 2 points Save Answer QUESTION 12 The parameter this refers to instance variables local variables global variables the calling object 2 points Save Answer QUESTION 13 The syntax that declares a Java named constant named SALES_TAX is: double SALES_TAX = 7.50; public double SALES_TAX = 7.50; public static double SALES_TAX = 7.50; public static final double SALES_TAX = 7.50; 2 points Save Answer QUESTION 14 The value of the expression (int ) 27.6 evaluates to: 28 27 26 None of the above 2 points Save Answer QUESTION 15 There is/are ______ copy/copies of a static variable available to objects of a class. one two three none of the above 2 points Save Answer QUESTION 16 To mark a block comment for inclusion in the Javadoc documentation, the block must be delimited by: /** */ * /* */ **/ /* **/ */ 2 points Save Answer QUESTION 17 Two methods that are expected to be in all Java classes are: getName and setName toString and equals compareTo and charAt toLowerCase and toUpperCase 2 points Save Answer QUESTION 18 What Java package includes the class Scanner? awt swing io util 2 points Save Answer QUESTION 19 What does a derived class automatically inherit from the base class? instance variables static variables public methods all of the above 2 points Save Answer QUESTION 20 When you use the assignment operator with variables of a class type, you are assigning a: value primitive type local variable reference 2 points Save Answer QUESTION 21 Which of the following statements is WRONG? A derived class is a class defined by adding instance variables and methods to an existing class. Overriding is when a derived class redefines a method from the base class The modifier private means that an instance variable can be accessed by name outside of the class definition but inside of the package. Private methods of the base class are not available for use by derived classes 2 points Save Answer QUESTION 22 Which of the following statements is WRONG? Java has wrapper classes for primitive data types such as double, int, char, and string. A derived class inherits public instance variables, private instance variables, and public methods from the base class. To use a class in a different package, the program must import the package You may use methods of the Math class without an import statement 2 points Save Answer QUESTION 23 Which of the following statements is WRONG? A child class can inherit all the static variables from its parent class An object of class A is an instance of class A. An array has a public method, which is named length(). An array name references a memory address 2 points Save Answer QUESTION 24 Which of the following statements is WRONG? Java began as a language for home appliances The result of integer division is truncated in Java. Every Java program automatically imports the java.util package. Echoing input is good programming practice because it can reveal problems in the input. 2 points Save Answer QUESTION 25 Which of the following statements is WRONG? In a static class, you can not use the this parameter A main method can be placed inside a class definition It is considered good programming practice to validate a value passed to a mutator method before setting the instance variable. Java does not require that a variable be declared before it is used within a program. 2 points Save Answer Click Save and Submit to save and submit. Click Save All Answers to save all answers.
Solution
1 ans)A derived class is also called as sub class
2 ans)public void method1(int arr[] a){}
3 ans)syntax error
4 ans)break
5 ans)cannot be accesed by name in another class
6 ans)Autoboxing or boxing
7 ans)byte code
8 ans)mutator
9 ans)Object
10 ans)Arguments
11 ans)it is used to create an object for class
12 ans)instance varialble
13 ans)double SALES_TAX=7.50
14 ans)27
15 ans)1
16 ans)/*(start)
*/(end)
17 ans)getName and setName
18 ans)util
19 ans)methods
20 ans)value
21 ans)private method declared in clas can be acces outised the class defined but inside the package
22 ans)derived class inherits public instance,private instance variabel and public methods
23 ans)A child class can inherit all the static variable from parent class
24 ans)every javva statement autmatically import java.util
25 ans)it is consider to begood programing practice to validate a value passed to a mutatot method before setting the instance variable

