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 7927121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T19:09:10+00:00 2026-06-03T19:09:10+00:00

I have an Array of AutoMobiles This array may contain SubClass Objects Truck or

  • 0

I have an Array of AutoMobiles
This array may contain SubClass Objects Truck or Car.

How do I test a Position in the Array for the type of Object?
eg:

if(AutoMobileArray[1].IsObject(Car)){}

The Car Class has a unique Accessor

public String BootSpace()

How can I use the SubClass Objects Accessors?
eg:

if(AutoMobileArray[1].IsObject(Car))
{
    BootSpaceLabel.Text = AutoMobileArray[1].BootSpace();
}
  • 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-03T19:09:11+00:00Added an answer on June 3, 2026 at 7:09 pm

    Well, If I understand you correctly, there’s the is operator:

    if(AutoMobileArray[1] is Car)
    {
      //Do stuff here
    }
    

    To do stuff with the subclass (access methods defined in the subclass etc.) you need to cast:

    if(AutoMobileArray[1] is Car)
    {
      Car c = (Car)AutoMobileArray[1];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Array of objects SomeObjects[] objects. This 'objects' may contain type of 'Employee',
I have array result like this: Array ( [0] => stdClass Object ( [id_global_info]
I have array object in jquery. array=[]; array{Id:user.Id,Date:user.Date}; Now am going to pass this
I have array of objects with created images (Object.Image), i want to show images
I have array like this: $test = array(20, 30, 40); And I want to
I have array like this: $test = array(20, 30, 40); And I want to
Why, if I have array of objects like this: class testClass { private $_x
I have array like this: $path = array ( [0] => site\projects\terrace_and_balcony\mexico.jpg [1] =>
Hello i have array like this [0] => Array ( [ExamMonth] => Array (
i have array in php, and i need work with this array in jQuery.

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.