Questions
ayuda
option
My Daypo

ERASED TEST, YOU MAY BE INTERESTED ONSE2019 Java

COMMENTS STATISTICS RECORDS
TAKE THE TEST
Title of test:
SE2019 Java

Description:
SE2019 Java

Author:
karim.mohamed
(Other tests from this author)

Creation Date:
30/08/2020

Category:
University

Number of questions: 83
Share the Test:
Facebook
Twitter
Whatsapp
Share the Test:
Facebook
Twitter
Whatsapp
Last comments
No comments about this test.
Content:
A class defines only the properties for objects. True False.
Creating an object is referred to as instantiation. True False.
Each class in the source code is written into a .class file. True False.
class file is compiled into .java file. True False.
Constructors must have the same name as the class itself. True False.
Constructors can be overloaded for making it easy to construct objects with different initial data values. True False.
A class may be defined without constructors True False.
A class is essentially a built-in primitive type. True False.
Reference data fields in class are initialized by default to the zero value. True False.
Static variables are also known as class variables. True False.
All objects of the class share its instance variables. True False.
A class method cannot access instance members (i.e., instance data fields and instance methods) of the class. True False.
Static methods can be called without creating an object of the class. True False.
All objects of the class share constants in a class. True False.
Static methods and static data fields can be accessed from their class name. True False.
An instance method can invoke an instance or static method, and access an instance or static data field. True False.
Java provides the private and protected visibility modifiers for class and class members. True False.
If we want to prohibit the user from creating an instance of a class, we should use a private constructor. True False.
To enable a private data field to be updated, we should provide an accessor method to set a new value in it. True False.
The object is actually passed by value to a method. True False.
When an array of objects is created, each element in the array is a reference variable with a default value of null. True False.
An object whose contents cannot be changed once the object has been created is called immutable object. True False.
A class with all private data fields and no mutators is necessarily immutable. True False.
A variable defined inside a method is referred to as a local variable. True False.
The scope of a class’s variables (instance and static) is the entire class, regardless of where the variables are declared. True False.
If a local variable has the same name as a class’s variable, the class’s variable takes precedence and the local variable with the same name is hidden. True False.
The keyword this refers to a class's data field hidden by a method or constructor local parameter, or to invoke an overloaded constructor by the calling object itself. True False.
In OOP, class abstraction concept separates class implementation details from how the class is used. True False.
A primitive-type value is not an object, but it can be wrapped in an object using a wrapper class in the Java API. True False.
Converting a primitive value to a wrapper object is called boxing and the reverse conversion is called unboxing. True False.
Wrapper classes of primitive types are imported from the java.util package. True False.
wrapper classes do not have no-argument constructors. True False.
The instances of all wrapper classes are immutable. True False.
The Double wrapper class can be used to represent decimals of any size and precision. True False.
A String object is mutable. True False.
Inheritance is used to model the has-a relationship between classes. True False.
Private members of a super class can be used directly in a subclass. True False.
A Java class may inherit directly from only one superclass. True False.
A subclass is not a subset of a superclass because it usually contains more variables and methods than its superclass. True False.
When constructing an object of a subclass, the subclass constructor must first invoke its superclass constructor before performing its own tasks True False.
to override a method, the method must be defined in the subclass using the same signature and the same return type. True False.
A private method in a superclass cannot be overridden in a subclass. True False.
A static method in a superclass can be overridden in a subclass. True False.
Method overloading means to provide a new implementation for a method in the subclass. True False.
Overridden methods can be either in the same class, or in different classes related by inheritance. True False.
Every class in Java is by default extending from the Object class True False.
Polymorphism means that a reference variable of a superclass can refer to a subclass object. True False.
You can always successfully cast an instance of a superclass to a subclass reference variable. True False.
The == operator can be used to check whether two objects have the same contents or not. True False.
ArrayList object is used to store a dynamic list of primitive values or objects. True False.
Subclass cannot weaken the accessibility of a method defined in the superclass. True False.
A class with no modifier is accessible by classes from other packages. True False.
The protected visibility modifier enable the members of the class to be accessed by the subclasses in any package or classes in the same package. True False.
A method defined as final in a superclass cannot be overridden in the subclasses. True False.
An abstract class can be used to create objects. True False.
It is not possible to define an abstract class that does not contain any abstract methods. True False.
A subclass can be abstract even if its superclass is non-abstract. True False.
Abstract methods must not be static. True False.
Each interface is compiled into a separate bytecode file, just like a regular class. True False.
You cannot create a new instance from an interface. True False.
A class cannot implement multiple interfaces. True False.
In abstract class definition, all variables must be public static final. True False.
An interface can inherit other multiple interfaces using the extends keyword. True False.
Interface must not contain constructors. True False.
Interface can be as a data type for a reference variable, as the result of casting, and so on True False.
The operator …….. is used to access a data field or invoke a method from an object. – (Dash) . (Dot) -> (Arrow) _ (Underscore).
A class provides method of a special type, known as ………, which is invoked to create a new instance final ٍstatic abstract constructor.
……… method does not have a return type Static Instance Constructor Abstract.
Constructors are invoked using the ……… keyword when an instance is created. new instanceof super this.
A public no-argument constructor is provided automatically only if no constructors are explicitly defined in the class, and in this case it is called the ……… constructor. super final default abstract.
The ……… visibility modifier allows classes, methods, and data fields to be accessible by any class in the same package only. Public Default Protected Private.
the keyword ------- to enable a constructor to invoke another constructor of the same class. Super This New Instanceof .
the BigInteger and BigDecimal classes are imported fro use from --------- package. java.lang java.util java.math javafx.java.
If a method has the public visibility modifier in a superclass then its overridden version in the subclass must have the ……… visibility modifier public protected default private.
The ……….. can be used to represent integers of any size int primitive type long primitive type Integer wrapper class BigInteger class.
The ……… package is imported by default in any java project java.lang java.util java.math javafx.geometry.
In OOP, the ………. relationship allows you to define new classes from existing classes association aggregation inheritance composition.
When multiple methods have the same name but different signatures, this is method overriding overloading encapsulation abstraction.
To prevent a class from being extended, it should be defined as ………. abstract static final private.
Constructor in an abstract class is defined as ……… because it is used only by subclasses private protected default public.
Defining data fields of a class as private is known in OOP as the concept of data ………. encapsulation inheritance polymorphism abstraction.
Anonymous object is an object without a name. True False.
It is not necessary that a Java program contain a main class. True False.
Report abuse Consent Terms of use