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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:32:28+00:00 2026-06-01T23:32:28+00:00

UserCourse and NewReleases are different class with same method. but different output. final Object

  • 0

UserCourse and NewReleases are different class with same method. but different output.

final Object userCourses;

    if(mFlag == 11){
            try{
                userCourses = new UserCourses(params[0]);
            }catch(Exception e){
                Log.i(TAG, "Exception: " + e.getMessage());
            }

        }
        else if(mFlag == 44){
            try{
                userCourses = new NewReleases();
            }catch(Exception e){
                Log.i(TAG, "Exception: " + e.getMessage());
            }
        }

Now, when I call

userCourses.getUserCourses().get(i);

I get “Add cast to userCourses” error.
Both class has this method.

Is it possible to do this or not? If yes please tell me how.

  • 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-01T23:32:30+00:00Added an answer on June 1, 2026 at 11:32 pm

    How would you expect this to work, useCourses is of the base type Object – which does not have this method.

    Learn about Interfaces and how to use them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've 3 tables: User, Course, UserCourse how do I save the different courses for
I'm currently developing a little Python website using Pyramid. But I don't know how
Here's the query (the largest table has about 40,000 rows) SELECT Course.CourseID, Course.Description, UserCourse.UserID,
I am having troubles generating a simple database form model. I am using: Doctrine
With lists of dictionaries such as the following: user_course_score = [ {'course_id': 1456, 'score':
I want to run a query which grabs all courses . Each row (course)
I'm not sure if I worded the question correctly. I am dynamically building a
I am trying to get a One-To-Many relation working. I have the following mappings:
Get User Action [HttpGet] [ActionName(Index)] public ActionResult Get(int id) { User u = UserCore.GetUser(id);
<?xml version='1.0' encoding='UTF-8'?> <build> <actions> <hudson.model.CauseAction> <causes> <hudson.model.Cause_-UserCause> <authenticationName>roman</authenticationName> </hudson.model.Cause_-UserCause> </causes> </hudson.model.CauseAction> <hudson.scm.SubversionTagAction> <build

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.