0

programming languages Online Quiz - 31

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

Is sizeof a keyword?

  1. True

  2. False


Correct Option: B

Static method accecss non-static field or call non-static method (T/F)

  1. True

  2. False


Correct Option: B

What methods java providing for Thread communications

  1. Wait

  2. notify

  3. notifyAll

  4. Sleep


Correct Option: A,B,C

IOexception is a unchecked exception (T/F)

  1. True

  2. False


Correct Option: B

These classes are defined in separate files. Will this code compile successfully? package dir1; class Parent { public java.util.Set set; } package dir2; class Child extends dir1.Parent { void test() { set.add("Hello"); } }

  1. True

  2. False


Correct Option: A

For concatenation of strings, which method is good, StringBuffer or String

  1. String

  2. StringBuffer

  3. Both

  4. None


Correct Option: B

For concatenation of strings, which method is good, StringBuffer or String

  1. String Buffer

  2. String

  3. both

  4. none


Correct Option: A

The following are used for Thread communication

  1. wait,notify,notifyall

  2. wait,notify,notifyall,sleep

  3. Yield,sleep

  4. yield, sleep, wait


Correct Option: A

Java provide ______ construct to find out the size of an object

  1. sizeOf ()

  2. size()

  3. getSize()

  4. No such method in java to find size of an object directly.


Correct Option: D

modifiers that allowed for methods in an Interface

  1. public, abstract

  2. abstract, final

  3. final

  4. public


Correct Option: A

What is "delete" in java?

  1. a Keyword

  2. a method

  3. a special identifier

  4. none


Correct Option: D

Differences between Value types and Reference types

  1. Value type variables are stored on stack. Reference type variables are stored on heap.

  2. Value type holds the data directly, Reference type points to the location that holds the data.

  3. Value type cannot contain null value. Reference type can contain null value.

  4. A new type cannot be derived from value type. A new type can be derived from reference type.

  5. All of the above


Correct Option: E

Which of the following is value type

  1. string

  2. class

  3. delegate

  4. struct

  5. interface


Correct Option: D

what is the difference between indexer and property

  1. An indexer is always an instance member, but a property can be static also.

  2. A property is always an instance member, but An indexer can be static also.

  3. Indexers can not be participate in inheritance, properties can also participate in inheritance

  4. No difference


Correct Option: A

Abstract methods should override in non abstract child class. If the child class is also abstract class then abstract methods overriding is not mandatory.

  1. True

  2. False


Correct Option: A

Structure

  1. Structures can be used as a base for other structures.

  2. A structure can implement one or more interfaces.

  3. Structure members can be methods, fields, indexers, properties, operator methods, and events.

  4. Structures can also define constructors, but not destructors. And you cannot define a default (parameterless) constructor for a structure.


Correct Option: B,C,D

Generic Constraints

  1. Can not use in structs

  2. A derivation constraint

  3. A default constructor constraint

  4. A reference/value type constraint


Correct Option: B,C,D

C# allows you to define static methods that use generic type parameters

  1. True

  2. False


Correct Option: A

A delegate defined in a class can take advantage of the generic type parameter of that class

  1. True

  2. False


Correct Option: A

.NET allows you to have serializable generic types

  1. True

  2. False


Correct Option: A
- Hide questions