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

  • Home
  • SEARCH
  • 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 8392749
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:35:52+00:00 2026-06-09T19:35:52+00:00

How do I solve this error? I tried just this , and (Article) this

  • 0

How do I solve this error? I tried just this, and (Article) this, and super.iterable(), but nothing seems to work. Only types of Article will ever be added to this queue. Java 1.7.0_03.

[javac] C:\cygwin\home\Chloe\Queue.java:26: error: incompatible types
[javac]             for (Article a: (Iterable) this) {
[javac]                             ^
[javac]   required: Article
[javac]   found:    Object

Here is the source code.

public class Queue<T> extends ArrayDeque {

public int words() {
    int words;
    for (Article a: (Iterable) this) {
    }
}
}
  • 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-09T19:35:55+00:00Added an answer on June 9, 2026 at 7:35 pm

    The iterator of your queue will return T Object instances, not Article. Your loop should go like this:

    public int words() {
        int words;
        for (Object a: this) {
           // do something
        }
    }
    

    Or, if you need an article queue, declare the class this way:

    public class Queue extends ArrayDeque<Article> {
    
      // this queue will store Article instances
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've tried to solve this error message but I couldn't. I've tried for a
My question is not about how to solve this error(I already solved it) but
I've tried to solve this before in another post but was unsuccessful. This is
Just read this interesting article by Omar on his blog Linq to SQL solve
I'm quite new to PHP so I don't know how to solve this error.
How to solve this HTML 5 validation error related to Facebook like button? Here
I am overloading the assignment operator, and am getting this error. Cannot solve it.
This code shows syntax error in the parameter declaration.. Pls help me to solve
This query gives me syntax error in when-between line. how can i solve them?
I'm trying to solve a segmentation fault. This message appears in my apache-error.log: [notice]

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.