Selenium Practice Test – 7 Posted by Editor Date 2022-09-24 Comments 0 comment Welcome to your Selenium Practice Test - 7 In Java, declaring a class abstract is useful A) To prevent developers from further extending the class B) When it doesn’t make sense to have objects of that class C) When default implementations of some methods are not desirable D) To force developers to extend the class not to use its capabilities E) When it makes sense to have objects of that class. A package is a collection of Classes B) Interfaces C) Editing tools D) Classes and interfaces E) Editing tools and interfaces A method within a class is only accessible by classes that are defined within the same package as the class of the method. Which one of the following is used to enforce such restriction? A) Declare the method with the keyword public B) Declare the method with the keyword private C) Declare the method with the keyword protected D) Do not declare the method with any accessibility modifiers E) Declare the method with the keyword public and private. What is the error in the following class definitions? Abstract class xy { abstract sum (int x, int y) { } } A) Class header is not defined properly. B) Constructor is not defined. C) Method is not defined properly D) Method is defined properly E) No error. Which of these field declarations are legal within the body of an interface? A) Private final static int answer = 42 B) public static int answer=42 C) final static answer =42 D) int answer E) No error. The methods wait ( ) and notify ( ) are defined in A) Java. Lang. thread B) Java. Lang. string C) Java. Lang. thread group D) Java. Lang. object For the method that does not return a value, the keyword used is A) Boolean B) Void C) Null D) Short .The concept of multiple inheritances is implemented in Java by I. Extending two or more classes. II. Extending one class and implementing one or more interfaces. III. Implementing two or more interfaces. A) Only (II) B) (I) and (II) C) (II) and (III) D) Only (I) E) Only (III). Inheritance A) Enables to add additional features to an existing class without modifying it B) Supports the concept of hierarchical classifications C) Is a process by which objects of one class acquire the properties of objects of another class D) All of these What is garbage collection in the context of Java? A) The operating system periodically deletes all of the java files available on the system. B) Any package imported in a program and not used is automatically deleted C) When all references to an object are gone, the memory used by the object is automatically reclaimed D) The JVM checks the output of any Java program and deletes anything that doesn’t make sense. E) When all references to an object are gone the memory used by the object is not reclaimed. Time is Up! Time's up Share: Editor Previous post Selenium Practice Test - 6 2022-09-24 Next post .Net Practice Test -1 2022-09-26 You may also like Oracle Tutorial Videos 8 April, 2023 Spring Tutorial Videos 8 April, 2023 Ui Technologies Tutorial Videos 1 April, 2023