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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:08:53+00:00 2026-06-09T18:08:53+00:00

I have been reading a design patterns book and it is full of java.

  • 0

I have been reading a design patterns book and it is full of java. I just have some basic understanding of java. I am now trying to implement some of the codes, but I am facing some difficulties.
For example, there are different classes written in different files. All of these classes have been made into a package. Now, when I try to javac the java file where the main is, it complains that it cannot find the other classes (in this case, WeatherData and CurrentConditionsDisplay).

Here is the main file:

package headfirst.src.observer.weatherobservable;

public class WeatherStation {

    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditionsDisplay currentConditions = new CurrentConditionsDisplay(weatherData);`
        //StatisticsDisplay statisticsDisplay = new StatisticsDisplay(weatherData);
        //ForecastDisplay forecastDisplay = new ForecastDisplay(weatherData);

        weatherData.setMeasurements(80, 65, 30.4f);
        weatherData.setMeasurements(82, 70, 29.2f);
        weatherData.setMeasurements(78, 90, 29.2f);
    }
}

I just need to know how to compile the files properly. The java code in the book is pretty basic, and I can understand it. But I just cannot get the files to compile!!!

  • 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-09T18:08:54+00:00Added an answer on June 9, 2026 at 6:08 pm

    I guess you are trying to compile the files via command-line. As I see you have packages, please first try this in an IDE like eclipse to get hands on “how to run the programs?”

    Via command-line you need to pass the approriate classpath, which you can learn at a later stage.

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

Sidebar

Related Questions

I have been reading a lot on design patterns lately and some of them
I have just been reading over some of my old oo design books and
I've been doing some reading about design patterns and wanted some perspective. Consider the
I've been reading Design Patterns, by Gamma et al. I have a question concerning
Reading up on design patterns, and have found that there are 23(?) some-odd patterns
I've been reading a book about design patterns for Objective-C and many times I've
I've been reading Diaz's book Pro JavaScript Design Patterns. Great book. I myself am
I have been reading up on Java and oop design. One of the exercises
I have been reading a lot about how flash development/design had died, and as
I have been reading templates,functors,callback function for the past week and have referred some

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.