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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T09:07:43+00:00 2026-06-08T09:07:43+00:00

this is my code (trying to write a copy constructor for my class): public

  • 0

this is my code (trying to write a copy constructor for my class):

public class ArgumentTree<GameArgument, Attack> extends DelegateTree<GameArgument, Attack>
{
    public ArgumentTree()
    {super();}

    public ArgumentTree(ArgumentTree<GameArgument, Attack> sourceTree)
    {
        super();
        Attack atck = new Attack(); // I get the Error here
        more code....
    }
}

I am getting this error:

unexpected type  
 required: class  
 found:   type parameter Attack  

just to clarify: I don’t want to make the code generic. I already know that the types I will use will be only GameArgument and Attack. Also, Attack has its own proper default constructor.

  • 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-08T09:07:45+00:00Added an answer on June 8, 2026 at 9:07 am

    You are using actual class names as type variables. This doesn’t make sense. Maybe you want something like

    public class ArgumentTree extends DelegateTree<GameArgument, Attack>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write this code using mostly arrays. I'm trying to get Correct
I am trying to write a simple tool using Shoes. This will indent code
I'm trying to write a code that could print something like this -xv -xvv
I'm trying to write a regular expression for html code that looks like this:
When trying to compile this code: #include <iostream> #include <vector> using namespace std; class
I am trying to copy DB from assets folder to device. This code is
I'm trying to write a copy constructor for an object managing a STL map
I am trying to write VBA code that will select a named range, copy
I'm trying to write some metaprogramming code such that: Inheriting from some class foo<c1,
I am trying to write some code which will open List1.txt and copy the

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.