Search This Blog

Tuesday, March 24, 2026

String Array - Java

 Which of the following statements will you use to create an initialized array of 5 strings?

a) String str = [“hi”, ”Fiona”, ”Ruby”, ”Dixie”, “Petunia”];

b) String str[] = new String[5] {“hi”, ”Fiona”, ”Ruby”, ”Dixie”, “Petunia”};

c) String str[] = {“hi”, ”Fiona”, ”Ruby”, ”Dixie”, “Petunia”};

d) String str[5] = {“hi”, ”Fiona”, ”Ruby”, ”Dixie”, “Petunia”};


Created by Nancy K.A.N.

@ 22:01 24-Mar-2026

Wednesday, March 18, 2026

Java - In General - 1

 In 1998, JCP (Java Community Process) was established. JCP is an open mechanism for developing and standardizing Java technical specifications. The key features of JCP are standardization, expert groups, transparency, and JSRs.  Developers, Java enthusiasts, and organizations can contribute and collaborate on new Java features. JSR is key to the development of the Java language. JSR stands for:

a) Java System Request

b)  Java Standardization Request

c) Java Service Request

d) Java Specification Request


Created by: Nancy K.A.N.

@21:53 18-March- 2026

Wednesday, February 11, 2026

Java Multithreading - 6

 How many times can you start a same Java thread?

a) once only

b) Any number of times 

c) Three times


Created by: Nancy KAN

@11:17 11-Feb-2026


Friday, February 6, 2026

Java Control Structures - switch Part 1

 Why will you use yield in a switch - case in Java?

a) It is a replacement for the default

b) It can handle multiple case statements

c) It is the only statement that can be used in the default

d) To execute multiple lines of code block in a switch and return a value


Created by Nancy K.A.N

@15:44 06-Feb-2026

Wednesday, January 28, 2026

Java Programming - A revision - episode 1

 What are the main reasons that Java is not considered a pure Object-Oriented Programming language?

a) Java uses pointers 

b) Java uses primitive data types like int, float, double, and so on

c) Java uses a main method like the C programming language, which is not OOP

d) Java uses static variables and methods, which are outside the scope of objects


Created by Nancy

@13:34 28-Jan-2026

Tuesday, December 16, 2025

Java Datatypes - 3

 Which of the following are not a Java datatypes?

a) boolean

b) bool

c) long

d) void

e) long float


Created by Nancy K.A.N.

@13:19 16-Dec-2025

Friday, December 5, 2025

Java Classes and Objects - 1

 ____________________ is a class whose objects cannot be changed after created.


a) A subclass

b) A final class

c) An immutable

d) An Inner class


Created by: Nancy KAN

@17:33 05-Dec-2025

Monday, November 3, 2025

Java Math API - 3

What is the output of the following code?

1. public class MathDemo2 {

2.     public static void main(String[] args) {

3.         System.out.println(Math.max(29,Math.min(93,Math.min(54,Math.max(47,45)))));

4.     }

5. }

6.  


Created by Nancy K.A.N.
@23:31 03-Nov-2025

Friday, October 31, 2025

Java Packages

 Which of the following Java packages is automatically included in every Java program?

a) java.utils package

b) java.language package

c) java.lang package

d) java.io package


Created by Nancy K.A.N.

@ 31-Oct-2025

Wednesday, October 29, 2025

Java Intro

 What is WORA in Java?

a) Write Only, Read Access

b) Write Off, Read Access

c) Write Once, Read Anywhere

d) Write Once, Run Anywhere


Created By: Nancy K.A.N.

@11:47 29-Oct-2025

Saturday, October 25, 2025

PRNG - Java

 Which of the following methods is not found in the Pseudo Random Number Generator (PRNG) API?

a) NextInt()

b) NextLong()

c) random()

d) NextDouble()


Created by Nancy K.A.N.

@13:03 25-Oct-2025


Tuesday, October 14, 2025

Java Closeable Interface methods

 Which of the following is a method of a Closeable interface?

a) void close (ByteStream ob)

b) void close (CharacterStream ob)

c) void close (FileStream file)

d) int close()

e) void close()


Created by Nancy K.A.N.

@00:36 15-Oct-2025

Monday, October 6, 2025

String Literals - 1

 Where JVM stores the string literals?

a) Stack memory

b) Special area on the stack

c) String constant pool

d) none of the above


Created by Nancy K.A.N.

@13:32 06-Oct-2025

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