Forum Stats

  • 3,750,551 Users
  • 2,250,192 Discussions
  • 7,867,005 Comments

Discussions

Generic Object creation

Pratap Dalai
Pratap Dalai Member Posts: 27
edited Aug 21, 2016 9:19PM in Generics

Please tell me why the below code is giving error.

class parent<T>

{

T ob;

public parent()

{

ob=new T(); // Can not create an instance of parameterized type

}

Answers

This discussion has been closed.