Reflection typeof

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm trying to accomplish the below, and for some reason keep getting errors saying
Type Expected. can someone assist me?

{
Type t = new typeof(Apple);

---etc
 
Instead try:

Type t = Apple.GetType(); // If Apple is the instance name
Or
Type t = typeof(Apple); // If Apple is the class name

I'm trying to accomplish the below, and for some reason keep getting errors
saying
Type Expected. can someone assist me?

{
Type t = new typeof(Apple);

---etc
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top