programming languages Online Quiz - 188

Description: programming languages Online Quiz - 188
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

What are the steps involved in developing an RMI object?

  1. Define the interfaces

  2. Implementing Interface

  3. Compile the interfaces

  4. All the above

Correct Option: D

Which files contains the libraries, resources and accessories files like property files?

  1. .jar

  2. .war

  3. .ear

  4. .zip

Correct Option: A
  1. Document Type definition

  2. Document type decision

  3. Document type data

  4. Document type development

Correct Option: A

What is the output of following piece of code ? int x = 2; switch (x) { case 1:System.out.println(”1?); case 2: case 3:System.out.println(”3?); case 4: case 5:System.out.println(”5?); }

  1. No output

  2. 3 and 5

  3. 1, 3 and 5

  4. 3

Correct Option: B

Which of the following are true?

  1. The Void class extends the Class class.

  2. The Float class extends the Double class.

  3. The System class extends the Runtime class.

  4. The Integer class extends the Number class.

Correct Option: D

How many number of models are there in MVC architecture?

  1. 1

  2. 2

  3. 3

  4. 4

Correct Option: B

What is the role of Servlet in MVC architecture?

  1. Displaying page data

  2. Connecting to database

  3. Routing Requests

  4. Performing front end validations

Correct Option: C

Which of the following statements are true?

  1. UTF characters are all 8-bits.

  2. UTF characters are all 16-bits.

  3. UTF characters are all 24-bits.

  4. Unicode characters are all 16-bits.

Correct Option: D

How do we comment a line in html

    • */>
  1. //

Correct Option: A

How do we comment a line in a jsp

    • */>
  1. //

Correct Option: B

Constructors are used to

  1. initialize instance variables

  2. destroy variables

  3. both (a) and (b)

  4. None of the above

Correct Option: A

After the following code fragment, what is the value in a? String s; int a; s = "Foolish boy."; a = s.indexOf("fool");

  1. -1

  2. 0

  3. 4

  4. random value

Correct Option: A

To solve this question, the user needs to understand the behavior of the indexOf() method in Java. This method returns the index of the first occurrence of a specified substring within a given string. If the substring is not found in the string, the method returns -1.

In the given code fragment, the string s is initialized to "Foolish boy." and the indexOf() method is called on this string with the argument "fool". Note that the substring "fool" is not present in the original string with the same letter case. The index of the first occurrence of the substring "fool" in the string s is thus -1.

Therefore, the correct answer is:

The Answer is: A. -1

What is the difference between a TextArea and a TextField?

  1. A TextArea can handle multiple lines of text

  2. A textarea can be used for output

  3. TextArea is not a class

  4. TextAreas are used for displaying graphics

Correct Option: A

The method setLabel can be used with what type of Object?

  1. TextField

  2. int

  3. DoubleField

  4. String

Correct Option: C

Given the following statement: huey.setDouble(8.0*32.2+1.0); What must be the data type of huey?

  1. TextField

  2. DoubleField

  3. IntField

  4. double

Correct Option: B

AI Explanation

To determine the data type of huey, let's analyze the given statement: huey.setDouble(8.0*32.2+1.0).

In this statement, the setDouble() method is being called on huey, which suggests that huey is an object that has a setDouble() method.

By looking at the argument passed to setDouble(), which is 8.0*32.2+1.0, we can see that it involves floating-point numbers (numbers with decimal places) and arithmetic operations.

Based on this information, we can conclude that huey must be an object of the DoubleField type.

Therefore, the correct answer is B) DoubleField.

Given the following code fragment: int A[]; int i = 0; A = new int A[4]; while (i < 4) { A[i] = 10; i = i + 1; } What is the value of A[3]?

  1. 0

  2. 3

  3. 10

  4. unknown

Correct Option: C
  1. FIFO

  2. LIFO

  3. both (a) and (b)

  4. None of the above

Correct Option: B

The keyword used along with try catch block to execute a part of code even if an exception is not caught is

  1. Finalize

  2. Finally

  3. Final

  4. Financial

Correct Option: B

A queue follows

  1. FIFO

  2. LIFO

  3. both (a) and (b)

  4. None of the above

Correct Option: A

Break statement cannot be used in a

  1. For loop

  2. While loop

  3. if loop

  4. All the above

Correct Option: C
- Hide questions