Search This Blog

Thursday, August 28, 2025

Java Command line arguments - 2

 How many arguments can you pass to a Java application through the command line?

a) Depends on the platform

b) only one

c) There is no limit

d) 256


Created by Nancy K.A.N.

@10:38 28-08-2025

Wednesday, August 27, 2025

Java Command Line Arguments Type

 Arguments can be passed to a Java application at the command line. These arguments are received in the main method, as main is the entry point to a Java application. Your command line with command line arguments will look like this:

java MyApp 100 200 300 400

What is the data type of every command-line argument received in the main method?

a) int

b) Integer

c) String

d) String array


Created by Nancy K.A.N.

@13:48 27-Aug-2025


Tuesday, August 26, 2025

Data type conversion - Java

 An integer variable does not have a fractional component. When a floating point value is assigned to an integer ______________________ happens.

a) Shrinking

b) upcasting

c) nothing

d) truncation


Created by Nancy K.A.N.

@14:42 26-Aug-2025

Friday, August 22, 2025

Java Command Line Arguments

 A Java application can receive arguments from the command line. These arguments can later be processed according to the application requirements. The user can pass these arguments while invoking a Java application:

C:\> java MyApp hello 100 200 300 bye

hello, 100, 200, 300, bye, are the arguments passed to the application MyApp.

When Java launches the application, to which method are these arguments passed?

a) getEnv method

b) getProperties method

c) main method

d) clone method


Created by Nancy K.A.N.

@11:13 22-08-2025

Wednesday, August 20, 2025

Java Runtime

 Which of the following Java classes' objects is responsible for loading classes at runtime?

a) System

b) Runtime

c) ClassLoader

d) Class


Created by: Nancy K.A.N.

@19:41 20-Aug-2025

Friday, August 15, 2025

Java Inheritance - Constructors

 Which of the following is used to call a parent class constructor from the child class constructor?

a) extends

b) this(parent classname)

c) super

d) instanceof


Created by Nancy K.A.N.

@23:08 15-Aug-2025

Thursday, August 14, 2025

Java Inheritance - Keywords

 Which of the following keywords are related to inheritance in Java?

a) this

b) super

c) class

d) interface


Created by Nancy K.A.N.

@14:16 14-Aug-2025

Tuesday, August 12, 2025

Java IO - 2

 Java provides objects for standard input, output, and error. These are respectively in, out, and err. In which class are these objects defined or members of?

a) InputStream class

b) PrintStream class

c) System class

d) Console class


Created by Nancy K.A.N.

@11:34 12-Aug-2025

Saturday, August 9, 2025

Java main Method

 Java's main method is an entry point to a Java application. What is the return type of Java's main method?

a) int

b) float

c) void

d) double

Type your answer in the comments...


Created by Nancy K.A.N.

@14:20 09-Aug-2025

Friday, August 8, 2025

Java Multithreading - 5

 Java is a multithreaded language. Every Java thread has a priority. Every new thread is created with priority equal to the thread that created it. Thread priority plays an important role in the way threads are executed.

Which of the following is the data type of thread priority?

a) double

b) byte

c) long

d) int

e) float


Created by Nancy N.

@22:13 08-Aug-2025 

Thursday, August 7, 2025

Java Multithreading - 4

 Which of the following is not a thread state in Java?

a) WAITING

b) TIMED_WAITING

c) DESTROYED

d) TERMINATED

e) RUNNABLE

f) BLOCKED

g) TIMED_BLOCKED


Created by Nancy K.A.N.

@12:01 07-Aug-2025

Tuesday, August 5, 2025

Java Setup

 Which of the following environment variables will you use to set the Java path?

a) PATH

b) JDK_PATH

c) JAVA_HOME

d) JAVA_PATH


Created by Nancy K.A.N.

@15:23 05-Aug-2025

Saturday, August 2, 2025

Java Modules - 1

 Java modules are different from packages, and they add an additional encapsulation to applications. In which version of Java were modules added?

a) Java 7

b) Java 8

c) Java 9

d) Java 10


Created by Nancy K.A.N.

@16:59 02-Aug-2025

Friday, August 1, 2025

Java Keywords

 Keywords are the reserved words that have a predefined meaning in a programming language. I like to call them as action-associated or action-oriented words. Whenever you use a specific keyword, you are sure that a certain action will take place.

Java has 52 keywords, and some of the keywords are not used, like goto. Java has reserved identifiers or contextual keywords, such as exports, module, and others. And then there are literal values mistaken for keywords, like true, false, and null.

Which of the following is not a keyword of Java?

a) strictfp

b) synchronized

c) var

d) instanceof

e) volatile


Created by Nancy K.A.N.

@12:29 01-Aug-2025


Follow my blog and YouTube channel (@CodingWithNancy)