
Ab
Quiz by LAURA ANDREATTA
Feel free to use or edit a copy
includes Teacher and Student dashboards
Measure skillsfrom any curriculum
Measure skills
from any curriculum
Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
With a free account, teachers can
- edit the questions
- save a copy for later
- start a class game
- automatically assign follow-up activities based on students’ scores
- assign as homework
- share a link with colleagues
- print as a bubble sheet
14 questions
Show answers
- Q1What is the difference between instance variables and local variables in Java?Instance variables are only accessible within the main method. Local variables are declared within a class but outside any method.Instance variables and local variables are two different terms used to refer to the same concept.Instance variables are declared within a method or block and can be accessed from anywhere in the class. Local variables are declared within a class but outside any method.Instance variables are declared within a class but outside any method, and they have separate copies for each object instance. Local variables are declared within a method or block, and they are only accessible within that method or block.Instance variables are used for temporary storage of data. Local variables hold data that needs to persist throughout the entire execution of a class.30s
- Q2Which keyword is used to implement inheritance in Java?extendsimplementsinherits30s
- Q3Which of the following is true about abstract classes in Java?An abstract class can only have static methodsAn abstract class can have both abstract and non-abstract methodsAn abstract class can be directly instantiatedAn abstract class cannot have any fields or variables30s
- Q4What is the difference between an abstract class and an interface in Java?An abstract class can have method implementations and fields, while an interface cannotAn abstract class cannot have any abstract methods, while an interface canAn abstract class can be directly instantiated, while an interface cannotAn abstract class can implement multiple interfaces, while an interface cannot30s
- Q5Which of the following is NOT a valid statement about interfaces in Java?An interface can have method implementationsAn interface cannot be directly instantiatedAn interface can extend multiple interfacesAn interface can define constants30s
- Q6What is the purpose of an abstract class in Java?To restrict access to class membersTo implement multiple interfacesTo create objects directlyTo serve as a superclass for other classes30s
- Q7Which of the following statements accurately describes an abstract method in Java?An abstract method is always declared privateAn abstract method must have a return type of voidAn abstract method has no method bodyAn abstract method cannot be overridden30s
- Q8Which of the following is a valid statement about abstract classes in Java?An abstract class can be directly instantiatedAn abstract class can have both abstract and non-abstract methodsAn abstract class can only have static methodsAn abstract class cannot have any fields or variables30s
- Q9Which of the following statements about abstract methods in Java is true?An abstract method must be declared privateAn abstract method cannot be overriddenAn abstract method can have a return type of voidAn abstract method has no implementation30s
- Q10In Java, what is the keyword used to declare an abstract class?interfaceclassextendsabstract30s
- Q11Which of the following statements about abstract classes in Java is true?An abstract class must have all abstract methodsAn abstract class does not allow method implementationAn abstract class cannot be directly instantiatedAn abstract class can implement interfaces30s
- Q12What does extending a class mean in Java?Extending a class means copying all the properties and methods of another class.Extending a class means creating a duplicate class with the same properties and methods.Extending a class means creating a separate class that has its own properties and methods independent of any other class.Extending a class means creating a new class (child class) that inherits all the properties and methods of an existing class (parent class).30s
- Q13What is the difference between method overloading and method overriding in Java?Method overloading and method overriding have the same functionality in Java.Method overloading is the process of creating multiple objects from a class. Method overriding is the bundling of data and methods together within a class.Method overloading is the ability of a subclass to provide its own implementation of a method defined in its superclass. Method overriding is having multiple methods with the same name but different parameters in the same class.Method overloading is having multiple methods with the same name but different parameters in the same class. Method overriding is the ability of a subclass to provide its own implementation of a method defined in its superclass.30s
- Q14What is the purpose of getter and setter methods in Java?Getter and setter methods are used to access and modify the values of private class variables.Getter and setter methods are used to print information to the console.Getter and setter methods are used to create new objects in Java.Getter and setter methods are used to define the behavior of a class.30s