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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T19:43:22+00:00 2026-05-15T19:43:22+00:00

I have an abstract class Medium, where one of the datamembers is an enum.

  • 0

I have an abstract class Medium, where one of the datamembers is an enum.

private Taal talenOndertiteling[];

public enum Taal {
    NEDERLANDS, FRANS, DUITS, ENGELS, SPAANS, ITALIAANS
}
public Taal[] getTalenOndertiteling() {
    return talenOndertiteling;
}

public void setTalenOndertiteling(Taal[] talenOndertiteling) {
    this.talenOndertiteling = talenOndertiteling;
}

Now when I try to call the last method like this:

            BD bd1 = new BD();
            bd1.setTalenOndertiteling(Taal.ENGELS);

I’m getting an error. (The BD class implements the Medium class) Any ideas on how I should be calling the method? And what if I wanted to set several languates, how would I do that?

Thanks!

  • 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-05-15T19:43:24+00:00Added an answer on May 15, 2026 at 7:43 pm

    Your method accepts a Taal[] but your invocation passes a Taal. You have two choices:

    Either pass an explicit Taal[]:

    bd1.setTalenOndertiteling(new Taal[] {Taal.ENGELS});
    

    or, change the method declaration to take a vararg parameter and have the compiler do it for you:

    public void setTalenOndertiteling(Taal... talenOndertiteling) {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose we have abstract class A (all examples in C#) public abstract class A
I have abstract BaseController, which basically looks like below: public abstract class BaseController :
I have an abstract class that implements IDisposable, like so: public abstract class ConnectionAccessor
I have one abstract class -let's say myBase. And I want all the classes
I have one abstract class and many child classes. In child classes are from
If I have abstract class Parent { static object staticLock = new object(); public
I have one main interface and an abstract class implementing all derivable methods (that
i have Abstract class Public class Abstract baseClass { public abstract string GetString(); public
I have an abstract base class with a TcpClient field: public abstract class ControllerBase
I have abstract class public abstract class BaseClass { public delegate void ContextMenuClickHandler(object sender,

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.