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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:15:39+00:00 2026-06-18T14:15:39+00:00

To begin with I have three classes. One called: Temperature (superclass) Weather (subclass superclass)

  • 0

To begin with I have three classes. One called:

  1. Temperature (superclass)

  2. Weather (subclass superclass)

  3. UseTemperature (subclass that holds main method)

For this program the main method is only supposed to display the temperature in Celsius and wind speed. I do not know what the issue is though..

My issue is that setWindSpeed/getWindSpeed cannot be found within UseTemperature.

//TEMPERATURE:

public class Temperature
{
    private double degrees;


    public void setDegrees (double degrees)
    {
        this.degrees = degrees;
    }


    public double getDegrees ()
    {
        return degrees;
    }

/////////////////////////////////////////////////////////////////////////////////////////
//WEATHER:

public class Weather extends Temperature
{
    private double windspeed; // Number + km/h

    private void setWindSpeed (double windspeed) //setter
    {
        this.windspeed = windspeed;
    }


    public double getWindSpeed ()  //getter
    {
        return windspeed;
    }
}
/////////////////////////////////////////////////////////////////////////////////////////
//USE TEMPERATURE:

class UseTemperature // can be public but makes no diffrence
{
    public static void main (String args[])
    {
        Temperature temp;

        temp = new Temperature ();

        temp.setDegrees (40.0);      
        temp.setWindSpeed (70.0); // NOT FOUND IN TEMPERATURE

        System.out.print (temp.getDegrees ());
        System.out.print (" degrees ");

        System.out.println (temp.getWindSpeed()); // NOT FOUND IN TEMPERATURE
        System.out.println (" km/h");

    }
}
  • 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-18T14:15:40+00:00Added an answer on June 18, 2026 at 2:15 pm

    The class Temperature does not contain the methods setWindSpeed or getWindSpeed. You would need to create a Weather object and make those methods accessible to call them.

    Weather myWeather = new Weather();
    // set/get ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have three classes, one main class, one GUI class which uses awt+swing to
Possible Duplicate: Remove all classes that begin with a certain string I have a
I have a LaTeX table that looks like this: \begin{table}[!ht] \centering \small \caption{ \bf{Caption}}
Given a gem that defines top-level classes that clash with some code I have
The context: I have three views. One Introductory view, an Upload view and the
I am trying to do this process: Find all classes that begin with i18n_
I have two classes, Base and Derived . I provide a function that applies
I am working on an assignment and have to create two classes, one represents
I have one Class called System it contains some variables and two arrays and
It seems like I have begin ... rescue ... end statements everywhere in my

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.