in Education by
Which of these is an correct way of defining generic class? (a) class name(T1, T2, …, Tn) { /* … */ } (b) class name { /* … */ } (c) class name[T1, T2, …, Tn] { /* … */ } (d) class name{T1, T2, …, Tn} { /* … */ } This question was posed to me during an interview for a job. Asked question is from Type Interface in section Interfaces & Packages of Java Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
The correct choice is (b) class name { /* … */ } The best I can explain: The type parameter section, delimited by angle brackets (<>), follows the class name. It specifies the type parameters (also called type variables) T1, T2, …, and Tn.

Related questions

0 votes
    Which of these type parameters is used for a generic class to return and accept any type of object? (a) K ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these type parameters is used for a generic class to return and accept a number? (a) K (b) N ... Interfaces & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of the following is the correct way of implementing an interface salary by class manager? (a) class manager ... Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of the following is the correct way of implementing an interface A by class B? (a) class B extends A{ ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these is an correct way of defining generic method? (a) name(T1, T2, , Tn) { /* */ } ... topic in portion Generics of Java Select the correct answer from above options...
asked Feb 22, 2022 in Education by JackTerrance
0 votes
    Which of the following is the correct way of importing an entire package pkg'? (a) import pkg. (b) Import ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these keywords is used by a class to use an interface defined previously? (a) import (b) Import (c ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these is an correct way of defining generic class? (a) class name(T1, T2, , Tn) { ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of these is a mechanism for naming and visibility control of a class and its content? (a) Object (b) ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these access specifiers can be used for a class so that its members can be accessed by a different ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these can be used to fully abstract a class from its implementation? (a) Objects (b) Packages (c) ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these class allows us to get real time data about private and protected member of a class? (a) java. ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these access specifiers can be used for an interface? (a) Public (b) Protected (c) private (d) ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of this access specifies can be used for a class so that its members can be accessed by a different class ... & Packages of Java Select the correct answer from above options...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    Which of these is an correct way of defining generic method? (a) name(T1, T2, , Tn) { /* ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
...