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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T15:32:02+00:00 2026-05-19T15:32:02+00:00

I recently had a homework question where we were supposed to work with a

  • 0

I recently had a homework question where we were supposed to work with a chess board, and place a number of queens on the board.

The question was trivial in terms of difficulty, but what I wanted to ask was this:

Should I just make a boolean 2-D array and change every position that contains a queen to 1 or should I make a private class to represent a queen, that has x and y coordinates as instance variables?

This might not seem very important or pressing, but I’m using Java and it kinda gets to the core of the concept of OO programming. If we never use the modular capabilities of Java, then why use Java at all? We might as well have written the same thing in C or Python.

Which would be more appropriate in general do you think? I would appreciate it if you could restrict your answers to ones that are backed by reason, as opposed to opinions or personal preferences.

  • 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-05-19T15:32:02+00:00Added an answer on May 19, 2026 at 3:32 pm

    Should I just make a boolean 2-D array and change every position that contains a queen to 1 or should I make a private class to represent a queen, that has x and y coordinates as instance variables?

    There is no single general answer to such questions. Either one can be suitable in specific situations, solving specific problems.

    If we never use the modular capabilities of Java, then why use Java at all? We might as well have written the same thing in C or Python.

    The fact that Java is an OO language does not mean we must define and use classes and objects for every piece of data we need to represent.

    If I understand your question correctly, you are asking about an implementation detail. Object oriented programming is not so much concerned about the specific implementation details as it is concerned about encapsulating those implementation details behind a suitable interface which represents some important domain concept well. Hence clients of the class need not know nor think about its implementation details, only about the higher level abstraction represented by an interface.

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

Sidebar

Related Questions

Alright, i had this homework recently (don't worry, i've already done it, but in
I recently had to work on a project where the previous developer modified the
I recently had cause to work with some Visual Studio C++ projects with the
I don't have any significant experience with C++ but recently had to be involved
I recently transferred my site to PHP5.3 from PHP5.2. I had in place an
I recently had this question in an interview to write test cases to test
I recently had a need to interpret a DEC 32-bit floating point representation. It
We recently had a code review . One of my classes was used so
I recently had a problem during the deployment of a windows service. Four computers
I recently had a problem in my app where some of the subviews I

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.