Search This Blog

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

Friday, September 12, 2025

Java Math API - 2

 What will be the output of compiling and executing the following code?







a) -4

b) 4

c) 4.563

d) Compile-time error: Invalid argument type


Created by Nancy K.A.N.

@12:01 12-Sept-2025



Wednesday, September 10, 2025

Java IO - 3

 Which of the following interfaces does the InputStream class implement?

a) Serializable

b) SeekableByteChannel

c) Closeable

d) Flushable


Created by Nancy K.A.N.

@12:36 10-Sept-2025

Monday, September 8, 2025

Java Object duplication

 Which of the following methods can be used to create a copy of the object on which it is called?

a) copy

b) copyObject()

c) clone()

d) duplicate()

e)CloneCurrentObject()


Created by Nancy K.A.N.

@13:32 08-Sept-2025

Thursday, September 4, 2025

Java Process class

 The Java Process class provides methods for:

  • performing input
  • performing output
  • waiting for the process to complete
  • checking the exit status of the process, and
  • destroying the process
If you want to terminate a process and its subprocesses using a method of the Process class, which of the following methods will you use?

a) void exit()
b) int killforcibly()
c) int destroy()
d) void forcestop()
e) void destroyforcibly()

Created by Nancy K.A.N.
@11:55 04-Sept-2025


Tuesday, September 2, 2025

Java Math API - 1

 Which of the following is a superclass of java.lang.Math class?

a) System

b) Process

c) Integer

d) Object


Created by Nancy K.A.N.  

@14:52 02-Sept-2025