Tag: programming languages

Questions Related to programming languages

How do we comment a line in a jsp

    • */>
  1. //


Correct Option: B
  1. initialize instance variables

  2. destroy variables

  3. both (a) and (b)

  4. None of the above


Correct Option: A
  1. -1

  2. 0

  3. 4

  4. random value


Correct Option: A
Explanation:

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

  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
  1. FIFO

  2. LIFO

  3. both (a) and (b)

  4. None of the above


Correct Option: B
  1. FIFO

  2. LIFO

  3. both (a) and (b)

  4. None of the above


Correct Option: A