Technology Questions

Q:

What is the output of this program ?

class main_arguments {
            public static void main(String [ ] args)
            {
                String [][] argument = new String[2][2];
                int x;
                argument[0] = args;
                x = argument[0].length;
                for (int y = 0; y < x; y++)
                    System.out.print(" " + argument[0][y]);           
            }
        }

A) 1 1 B) 1 0
C) 1 0 3 D) 1 2 3
 
Answer & Explanation Answer: D) 1 2 3

Explanation:

In argument[0] = args;, the reference variable arg[0], which was referring to an array with two elements, is reassigned to an array (args) with three elements.
Output:
$ javac main_arguments.java
$ java main_arguments
1 2 3

Report Error

View Answer Report Error Discuss

Filed Under: Java
Exam Prep: GATE

1 79743
Q:

Which of the following can't be done with client-side JavaScript?

A) Sending a form's contents by email B) Storing the form's contents to a database file on the server
C) Validating a form D) None of the above
 
Answer & Explanation Answer: B) Storing the form's contents to a database file on the server

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: Web Technology

44 63963
Q:

class Hell {

public static void main(String[] args) {

Integer i = 42;

String s = (i<40)?"life":(i>50)?"base":"ball";

System.out.println(s);

}

}

A) null B) ball
C) base D) None
 
Answer & Explanation Answer: B) ball

Explanation:

D is correct. This is a ternary nested in a ternary with a little unboxing thrown in.Both of the ternary expressions are false.

Report Error

View Answer Report Error Discuss

Filed Under: Java

3 37670
Q:

Which operator performs pattern matching ?

A) LIKE operator B) EXISTS operator
C) BETWEEN operator D) None of these
 
Answer & Explanation Answer: A) LIKE operator

Explanation:

LIKE is a keyword that is used in the WHERE clause. Basically, LIKE allows us to do a search based operation on a pattern rather than specifying exactly what is desired (as in IN) or spell out a range (as in BETWEEN).

 

The syntax is as follows:
SELECT "column_name"
FROM "table_name"
WHERE "column_name" LIKE {PATTERN}

 

{PATTERN} often consists of wildcards.

 

In SQL, there are two wildcards:


% (percent sign) represents zero, one, or more characters.

_ (underscore) represents exactly one character.

 

More :: Certification Questions on SQL

Report Error

View Answer Report Error Discuss

29 37582
Q:

try { int x = Integer.parseInt("two"); }

Which could be used to create an appropriate catch block?

A) ClassCastException B) IllegalStateException
C) NumberFormatException D) None
 
Answer & Explanation Answer: C) NumberFormatException

Explanation:

C is correct. 'Integer.parseInt' can throw a NumberFormatException, and IllegalArgumentException is its superclass 

Report Error

View Answer Report Error Discuss

Filed Under: Java

5 34635
Q:

What is meaning of following declaration?
int(*p[5])();

A) p is pointer to function. B) p is array of pointer to function.
C) p is pointer to such function which return type is array. D) p is pointer to array of function.
 
Answer & Explanation Answer: B) p is array of pointer to function.

Explanation:
Report Error

View Answer Report Error Discuss

Filed Under: C++

16 31155
Q:

What is the correct JavaScript syntax to write “Hello World”?

A) System.out.println( B) println (
C) document.write( D) response.write(
 
Answer & Explanation Answer: C) document.write(

Explanation:

document.write() is a JavaScript command that literally writes out whatever you place between the opening and closing parentheses.

 

 

What_is_the_correct_JavaScript_syntax_to_write_“Hello_World”1556279922.jpg image 

Report Error

View Answer Report Error Discuss

Filed Under: Web Technology

15 29963
Q:

Choose the correct html tag to make a text italic.

1. <italic>

2. <it>

3. <i>

4. <il>

A) 1 B) 2
C) 3 D) 4
 
Answer & Explanation Answer: C) 3

Explanation:

HTML Tag  is used to make a text italic.

Report Error

View Answer Report Error Discuss

23 29837