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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:18:37+00:00 2026-05-17T00:18:37+00:00

For our assignment we need to write code for a neural network. The way

  • 0

For our assignment we need to write code for a neural network. The way I planned to do it was to write a Node class, which is a node within the network; a Layer class, which is a layer of nodes and a NeuralNet class, which is a network of layers.

I’m having a lot of trouble understanding the way Java is designed to work for imports. To me it seems that it should be a simple matter to include my Node class in my Layer class, and my Layer class in my NeuralNet class, however Java doesn’t like importing from the default package.

What I have read suggests that anything you import needs to be in a package and packages have their own subdirectory. Because of the way I plan to structure my classes, this leaves me with what seems to me, an unwieldy and unnecessarily complex directory structure ie.

neuralpkg.layerpkg.nodepkg.Node

Can someone explain to me whether this is the only way to implement the structure that I want or whether there is some much, much simpler way that I’ve missed?

For what its worth I’d have no trouble writing this in C/C++, but attempting to import in a similar style has only given me heartache.

  • 1 1 Answer
  • 3 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-05-17T00:18:37+00:00Added an answer on May 17, 2026 at 12:18 am

    You don’t need to layer the package like neuralpkg.layerpkg.nodepkg, where “neural”, “layer”, and “node” are subpackages for the respective classes.

    You can simply create a package named “ben” and put all of your classes in there. So within your source directory you’d have a layout like:

    --/ben
    ----Layer.java
    ----NeuralNetwork.java
    ----Node.java
    

    Each class definition should then start with the line package ben;.

    Classes in the same package don’t need to import each other.

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

Sidebar

Related Questions

In our class scripting assignment, we need to pass any number of directories as
I took a class named Secure Code, and in our next assignment we are
We just got our first major Perl CGI assignment in my CS class. Our
I am taking a software engineering class right now. Our assignment is to evaluate
I am working on a new assignment. Our instructor wants us to code a
for an assignment we need to benchmark our implementations with different optimizations and parameters.
We were given an assignment in our C programming class to modify a program
I'm writing an assignment for a databases class, and we're required to migrate our
There is a class in our code, say class C . I want to
I am working on a programming assignment in which we are making our own

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.