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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T00:21:20+00:00 2026-06-01T00:21:20+00:00

In the following contrived example, data is given a warning due to it being

  • 0

In the following contrived example, data is given a warning due to it being unused. Can someone explained why this is something to warn about?

public abstract class Worker {

    private Object data;

    public Worker(Object data) {
        this.data = data;
    }

    public abstract Result run();

}

The point of course, is that the data object is used, just not in this abstract class. What should I be doing to make this error go away, ie is it an eclipse setting, or am I just doing something wrong.

  • 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-01T00:21:21+00:00Added an answer on June 1, 2026 at 12:21 am

    The point of course, is that the data object is used, just not in this abstract class.

    How? It’s private. The subclasses won’t be able to see it, unless they’re using reflection.

    You could make it protected so that subclasses can see it – or better (IMO), provide a protected getData() method.

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

Sidebar

Related Questions

Given the following contrived example: I would like to query my data for all
Lets imagine I have something resembling the following contrived example ParkingSpace Car ParkingSpaceCar -------------
Given the following code (it's a macro that generates code for a list data
Is there a proper term in data modeling to describe the following? Given table
My simplified and contrived example is the following:- Lets say that I want to
Consider the following contrived example of a templated array definition: template <typename t, unsigned
I am wondering why the following contrived example code works perfectly fine in Visual
Following on from this question , I am interested in finding out how you
I want to retrieve the data contained in a text file (from a given
I am going to show a bit of a contrived example, so bear with

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.