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