answer the follow Questions to  the best of your ability:
Question 110 pts
Variables, methods, and constructors, which are declared protected in a superclass can be accessed only by the subclasses in other packages or any class within the package of the protected members' class.
Group of answer choices

True

False
 
Flag question: Question 2
Question 210 pts
What is Autoboxing?
Group of answer choices

A mechanism of wrapping the data (variables) and code acting on the data (methods) together as a single unit

A mechanism of Abstraction

when a primitive value is automatically converted to its matching wrapper class object

when an object of a wrapper class is automatically converted to its matching primitive value
 
Flag question: Question 3
Question 310 pts
What is the output of the following Java program?

 

public class Jump_statments {
    public static void main(String args[]) {
        int x = 2;
        int y = 0;
        for (; y < 10; ++y) {
            if (y % x == 0)
                continue;
            else if (y == 8)
                break;
            else

                System.out.print(y + " ");
        }
    }
}

Group of answer choices

2 4 6 8

1 3 5 7

1 2 3 4 5 6 7 8 9

1 3 5 7 9
 
Flag question: Question 4
Question 410 pts
Given these code snippets:
 

public abstract class Mineral {
    // define abstract methods for origin, hardness and appearance.
}
public class Diamond extends Mineral {
    // implement origin, hardness and appearance methods.
}

 

Is the following assignment valid?

Diamond d = new Mineral();

 

Group of answer choices

NO

YES
 
Flag question: Question 5
Question 510 pts
What is the most likely output of this program?

public class Main {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer("135");
        sb.replace(0, 5, "6789").insert(0, "12345");
        System.out.println(sb.reverse().delete(0, 5));
    }
}
Group of answer choices

6789

StringIndexOutOfBoundsException

4321

123456789
 
Flag question: Question 6
Question 610 pts
A method declaration has  (check all that are correct):
Group of answer choices

A name

An optional access speciﬁer which, if not present, defaults to package access.

At least one parameter

A return-type, or void if no value is returned.

Parentheses () - with or without a parameter list.
 
Flag question: Question 7
Question 710 pts
What is the return type of Constructors?...
Group of answer choices

No explicit return type

float

void

int
 
Flag question: Question 8
Question 810 pts
What is Inheritance in Object-Oriented Programming?
Group of answer choices

Refers to the ability of a variable, function or object to take on multiple forms

An ability by which one class acquires the properties and behaviors of another class

Process of hiding the implementation details from the user, only the functionality will be provided to the user. In other words, the user will have the information on what the object does instead of how it does it.

A process that binds together the data and functions that manipulate the data and that keeps both safe from outside interference and misuse.
 
Flag question: Question 9
Question 910 pts
What is Truncation for numeric variables in Java?
Group of answer choices

None of the Mentioned

Integer value assigned to ﬂoating type

Floating-point value assigned to an Floating type

Floating-point value assigned to an integer type
 
Flag question: Question 10
Question 1010 pts
What is the most likely output of this program?

public class Main {
	public static void main(String[] args) {
		StringJoiner sj1 = new StringJoiner(":", "{", "}");
		StringJoiner sj2 = new StringJoiner(",", "[", "]");
		sj1.add("Name").add("Tony");
		sj2.add("LastName").add("Strak");
		System.out.println(sj1.merge(sj2).toString());
	}
}
Group of answer choices

{Name:Tony:LastName,Strak}

{Name:Tony:[LastName,Strak]}

{[LastName,Strak,Name:Tony]}

Unresolved compilation problem: The method merge(":", "{", "}") in the type StringJoiner is not applicable for the arguments (",", "[", "]")
 
Flag question: Question 11
Question 1110 pts
If a class of a Java program has a plural number of methods, and all of them have the same name but diﬀerent parameters (with a change in type or number of arguments), then it is known as method overloading.
Group of answer choices

True

False
 
Flag question: Question 12
Question 1210 pts
What is the output of the following Java program? Please assume all classes are in the same package.

class A {
    String E = "extraction ";
    String T = "transformation ";
    String L = "loading ";

    final void ETL() {
        System.out.println(L + T + E);
    };
}

class B extends A {
    void ETL() {
        System.out.println(E + T + L);
    }
}

public class Main {
    public static void main(String args[]) {
        A obj = new B();
        obj.ETL();
    }
}

Group of answer choices

Runtime error

None of the mentioned

Compile time error

extraction transformation loading

loading transformation extraction
 
Flag question: Question 13
Question 1310 pts
IS-A relationship in Java is related to -
Group of answer choices

Composition

Inheritance

None of the mentioned

Encapsulation
 
Flag question: Question 14
Question 1410 pts
Which of the following loops will execute the body of loop even when condition controlling the loop is initially false?
Group of answer choices

while

do-while

None of the above

for
 
Flag question: Question 15
Question 1510 pts
Which of the following best describes the meaning of static?
Group of answer choices

The static keyword, when applied to ﬁelds, means that the ﬁeld can only be accessed through instances of the class.

When applied to a class, the static keyword implies that instances of the class are immutable.

The static keyword can be applied to local variables. This implies that their values persist between calls to the method that declares the variable.

The static keyword can be applied to class members. This implies that the class members (static ones) belong to the class, not to instances of the class.
 
Flag question: Question 16
Question 1610 pts
Which of these is an invalid Array declaration?
Group of answer choices

int[] arr = new int[5];

int[] arr; arr = new int[5];

None of the mentioned

int[] arr = new int[];