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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T08:20:08+00:00 2026-06-08T08:20:08+00:00

I have been banging my head for a while now, understanding java language. I

  • 0

I have been banging my head for a while now, understanding java language. I have been familiar with classes but i always get confused with object? I know the question sounds very stupid but I am still not able to figure out what a java object do and why do we need it. How different is it from a plain variable. How to call it. How can I use a java object defined in one class into another? These questions are mocking my head for a while now.
Could someone explain object in simple sentences?
Any help with some simple example would be very much helpful.

  • 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-08T08:20:10+00:00Added an answer on June 8, 2026 at 8:20 am

    A class defines the data and behavior that all the instances (objects) of this class will have. For example, the class Dog has a name and color fields, and a bark() method. Now if you want to make an application with three dogs, you will create three instances of the Dog class:

    Dog blacky = new Dog("Blacky", "black");
    Dog whity = new Dog("Whity", "white");
    Dog rooky = new Dog("Rooky", "red");
    

    Once you have a dog you can ask it to bark:

    blacky.bark();
    

    You could also imagine a House class, containing dogs:

    public class House {
        private Set<Dog> dogsInTheHouse = new HashSet<Dog>();
    
        public void addDog(Dog dog) {
            this.dogsInTheHouse.add(dog);
        }
    
        public void someOneIsAtTheDoor() {
            for (Dog dog : dogsInTheHouse) {
                dog.bark();
            }
        }
    }
    

    So you could create a house:

    House myHouse = new House();
    

    add dogs in the house:

    myHouse.add(blacky);
    myHouse.add(whity);
    myHouse.add(rooky);
    

    And when you come at the door of the house, all its dogs start barking:

    myHouse.someOneIsAtTheDoor();
    

    So an object can be composed of other objects, and objects can call each others methods to assemble a whole application.

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

Sidebar

Related Questions

Been banging my head on this for a while now The problem I have
I have been banging my head against this for a little while now. I
I have been banging my head over this one for quite a while now
I have been banging my head against this one for a while now and
I've been banging my head on this one for a while now. I want
Ok, I have been banging my head on this one for a while, figure
I have been banging my head against the wall trying to get Exscript installed.
I have been banging my head for quite a while with this and can't
I have been banging my head against this for some time now: I want
I've been banging my head against this issue for a while now and I'm

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.