Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8976769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T19:13:14+00:00 2026-06-15T19:13:14+00:00

I have a class like below:- public Class Student { string Name {get; set;}

  • 0

I have a class like below:-

public Class Student
{
  string Name {get; set;}
  int Age {get; set;}
  Address studentAddres {get; set;}
}

public class Address
{
 string Street{get; set;}
 string City {get; set;}
}

Here Name and Age are System Define type and StudentAddres is custom type. How to differentiate between them using code.
I am using Reflection but not able to achieve.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T19:13:15+00:00Added an answer on June 15, 2026 at 7:13 pm

    It seems that you want to see either a value type or a string. Then you can use:
    Type.IsPrimitive property

    Gets a value indicating whether the Type is one of the primitive
    types.

    The primitive types are Boolean, Byte, SByte, Int16, UInt16, Int32,
    UInt32, Int64, UInt64, IntPtr, UIntPtr, Char, Double, and Single.

    int i = 10;
    string str = "";
    var isPrimitive = i.GetType().IsValueType || i is string; // returns true since i is value type
    var isPrimitiveWithString = str.GetType().IsValueType || str is string; 
     // returns true
    
    CustomClass obj = new CustomClass();
    var isPrimitive3 = obj.GetType().IsPrimitive; // returns false
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have class like below class Person { public string Name{get;set;} public string Surname{get;set;}
i have class like below, public class SiteActionMap { public int Id { get;
Say I have a simple address class like below: public class Address { public
I have entity like below public abstract class MyBaseClass { public int Id {
I have 2 class like below, public class CheckInBean implements Serializable{ private String user;
i have a class like below public class Foo<T> { public List<T> Items{ get;
I have a class like below: class Foo { public Foo(int x) { ...
I have class like below template<class T> class Student { public: static Student& Instance();
I have a Quest and QuestTemplate class like below public class Quest{ public int
I have a Java class called Term holding polynomials like below public Term(int c,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.