0

programming languages Online Quiz - 67

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

Which interface is implemented by the services in order to pass configuration information to a Servlet when it first starts

  1. Structs Config

  2. WebXML

  3. ServletConfig

  4. None of the above


Correct Option: C

In JDBC ______________ used to create an instance of a driver and register it with the DriverManager. When you have loaded a driver, it is available for making a connection with a DBMS.

  1. Class.forName

  2. Class.JDBCODBC

  3. Class.JdbcDriver

  4. Class.Loader


Correct Option: A

_________ method for posting the information in Action class

  1. doGet()

  2. doPost()

  3. execute()

  4. validate()


Correct Option: B

Which abstract class is the super class of all classes used for writing characters. Select the one correct answer.

  1. FileWriter

  2. CharWriter

  3. Writer

  4. OutputStream

  5. FileOutputStream


Correct Option: C
Explanation:

To solve this question, the user needs to have knowledge of abstract classes and the hierarchy of classes used for writing characters.

The option A, FileWriter, is incorrect because it is a concrete class that extends CharWriter.

The option B, CharWriter, is incorrect because it is also a concrete class that extends Writer.

The option C, Writer, is the correct answer because it is the abstract class that serves as the superclass of all classes used for writing characters.

The option D, OutputStream, is incorrect because it is the superclass of all classes used for writing bytes.

The option E, FileOutputStream, is incorrect because it is a concrete class that extends OutputStream.

Therefore, the answer is: C. Writer

__________ will be automatically invoked when an object is created.

  1. method

  2. garbage collection

  3. finalizer

  4. Constructor

  5. none of the above


Correct Option: D

In order for a source code file, containing the public class Test, to successfully compile, which of the following must be true?

  1. It must have a package statement

  2. It must be named Test.java

  3. It must import java.lang

  4. It must declare a public class named Test


Correct Option: B

_____________ is the mechanism that servlets use to have a client hold a small amount of state information associated with the user.

  1. sessions

  2. HttpRequest

  3. HttpResponse

  4. Java Beans

  5. Cookies


Correct Option: E

If you want to modify the servlet, The webserver need to be shutdown.

  1. True

  2. False


Correct Option: B

Casting the return value from malloc function is necessary.

  1. True

  2. False


Correct Option: B

Which of the following functions is not present in ANSI standard?

  1. getchar();

  2. getche();

  3. ungetc();

  4. getch();


Correct Option: B,D

What is the scope of memory allocated with malloc function?

  1. Local to the file in which its allocated.

  2. Local to the function in which its allocated.

  3. Local to the block in which its allocated.

  4. Global


Correct Option: D

After we free an allocated memory block using free(), the pointer will become:

  1. null pointer

  2. wild pointer

  3. Dangling pointer

  4. None of the above


Correct Option: C

What is the following declaration for? int (*a)[10];

  1. Pointer to an array of 10 integers.

  2. A pointer to function returning an array of 10 integers.

  3. Array of 10 function pointers returning int

  4. Array of 10 integer pointers.


Correct Option: A

Consider the following declarations: int a[10]; int *p=a; Which among the following is portable way to print value of pointer p?

  1. printf("%d\n",p);

  2. printf("%u\n",p);

  3. printf("%lu",p);

  4. printf("%p\n",(void*)p);


Correct Option: D

It is possible to compare two structures using == operator.

  1. True

  2. False


Correct Option: B

It is possible to compare two structures using == operator.

  1. True

  2. False


Correct Option: B

Which is not a group function?

  1. Count

  2. Avg

  3. Total

  4. Max


Correct Option: C

You can use Avg or Sum group functions for any numeric data?

  1. True

  2. False


Correct Option: B

COUNT (DISTINCT expr) returns

  1. No. of rows in a table

  2. No. of rows with non-null values of the expr

  3. No. of distinct non-null values of the expr

  4. . None of the above


Correct Option: C

All columns in the SELECT list that are not there in the GROUP function, should be in the group by clause

  1. True

  2. False


Correct Option: B
- Hide questions