0

programming languages Online Quiz - 340

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

In Java the compiler will always insert a default , no argument constructor into any class definition

  1. True

  2. False


Correct Option: B

In a method call when an object reference is passed as an argument , So what gets passed actually ?

  1. The object itself

  2. a copy of reference

  3. the original reference

  4. a reference to a copy


Correct Option: B

In Java if an arithmetic operation is performed then , In case the operands are of different types the resulting type is always the widest of two types

  1. True

  2. False


Correct Option: B

A constructor can be declared abstract

  1. True

  2. False


Correct Option: B

The legal values for a boolean in java are choose all that applies

  1. 1,0

  2. TRUE,FALSE

  3. true , false , TRUE,FALSE

  4. true , false


Correct Option: D

Its possible for a non-abstract class to have abstract methods.

  1. True

  2. False


Correct Option: B

The following statement would allocate memory on? char *ptr = malloc(10);

  1. Stack

  2. Heap

  3. Code Segment

  4. Data Segment


Correct Option: B

In the following code variable test1 would be allocated memory on?int func(){int test1 = 10;return test1;}void main(){ int i = 0; i = func();}

  1. Heap

  2. Stack

  3. Code Segment

  4. Data Segment


Correct Option: B

Can we change the content of string letral?

  1. True

  2. False


Correct Option: B
  1. Compilation Error

  2. Arithmetic Exception

  3. Compiles with no errors

  4. None of the above


Correct Option: C

Consider the following case: A return statement is there in the catch block. An exception occurs and is caught. Now will the finally block be executed?

  1. will execute

  2. will not execute

  3. Compilation Error

  4. Runtime Exception


Correct Option: A

Overloaded methods should not throw new checked exceptions that have not been thrown by the original method?

  1. True

  2. False


Correct Option: B

Consider the following case; int i; int k; for(i=0;k<10;i++){/* The body */} This will not compile?

  1. True

  2. False


Correct Option: B
- Hide questions