0
Alien head

programming languages Online Quiz - 31

Description: programming languages Online Quiz - 31
Number of Questions: 20
Created by:
Tags: programming languages

.NET allows you to have serializable generic types

  1. True

  2. False

Answer: 1

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

  1. True

  2. False

Answer: 1

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

  1. True

  2. False

Answer: 1

Generic Constraints

  1. Can not use in structs

  2. A derivation constraint

  3. A default constructor constraint

  4. A reference/value type constraint

Answer: 2,3,4

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.

Answer: 2,3,4

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

Answer: 1

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

Answer: 1

Which of the following is value type

  1. string

  2. class

  3. delegate

  4. struct

  5. interface

Answer: 4

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

Answer: 5

What is "delete" in java?

  1. a Keyword

  2. a method

  3. a special identifier

  4. none

Answer: 4

modifiers that allowed for methods in an Interface

  1. public, abstract

  2. abstract, final

  3. final

  4. public

Answer: 1

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.

Answer: 4

The following are used for Thread communication

  1. wait,notify,notifyall

  2. wait,notify,notifyall,sleep

  3. Yield,sleep

  4. yield, sleep, wait

Answer: 1

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

  1. String Buffer

  2. String

  3. both

  4. none

Answer: 1

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

  1. String

  2. StringBuffer

  3. Both

  4. None

Answer: 2

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

Answer: 1

IOexception is a unchecked exception (T/F)

  1. True

  2. False

Answer: 2

What methods java providing for Thread communications

  1. Wait

  2. notify

  3. notifyAll

  4. Sleep

Answer: 1,2,3

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

  1. True

  2. False

Answer: 2

Is sizeof a keyword?

  1. True

  2. False

Answer: 2
+ View questions