Sail E0 Webinar
Question
What does the following code block define? class Gen {                    T ob;                  }
Options:
A .  Generics class decleration
B .  Decleration of variable
C .  a simple class decleration
D .  Both a & b
Answer: Option D


class Gen This defines the generics declaration where 'T' is the name of type parameter.This parameter is used as a placeholder for the actual type that will be specified when a Gen object is created.Gen is a generic class . T is used to declare a variable called 'ob'.



Was this answer helpful ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers