Search This Blog

Thursday, October 2, 2025

Java Closeable Interface

 Which of the following is the super interface of Closeable?

a) Close

b) AutoClose

c) AutoCloseable

d) Channel


Created by Nancy K.A.N.

@17:09 02-Oct-2025

Monday, September 29, 2025

Java super and this methods

 What will be the result of using super() and this() in the same method?

a) It will compile and run successfully

b) It will compile successfully, but will give a runtime error

c) It will give a compile-time error

d) Successful compilation and running will depend on the order in which super() and this() are used


Created by Nancy K.A.N.

@00:23 30-09-2025

Saturday, September 27, 2025

Java IO - Externalizable

 An Externalizable interface extends Serializable. Which of the following methods does an Externalizable interface add?

a) WriteData

b) WriteObject

c) WriteExternal

d) ReadData

e) ReadObject

f) ReadExternal


Created by Nancy K.A.N.

@00:44 28-Sept-2025

Wednesday, September 24, 2025

Java IO - Serializable

 Which of the following is not a method of a Serializable interface?

a) write()

b) serialize()

c) convertToBytes()

d) none (It has no methods)


Created by Nancy K.A.N.

@12:17 24-Sept-2025

Monday, September 22, 2025

Java Exceptions - 2

 Which of the following is a superclass of all exceptions and Errors in Java?

a) Exception

b) RuntimeException

c) Throwable

d) Error


Created by Nancy K.A.N.

@14:04 22-Sept-2025

Thursday, September 18, 2025

Java String API - 3

 Which of the following methods of the Java String class is deprecated?

a) getBytes(String)

b) getBytes(int, int,byte[],int)

c) getBytes(int,int,char[],int)

d) getBytes(charset)


Created by Nancy K.A.N.

@11:44 18-09-2025

Monday, September 15, 2025

Java Garbage Collection

 One of the features of Java is auto-garbage collection. It frees the coder from keeping track of deallocating memory, though you can request garbage collection. 

Which of the following can request garbage collection?

a) Runtime.free()

b) Runtime.getRuntime().gc()

c) System.gc()

d) System.clear()


Created by Nancy K.A.N.

@12:46 15-09-2025