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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:47:20+00:00 2026-05-15T04:47:20+00:00

How can I get a specific value from an object? I’m trying to get

  • 0

How can I get a specific value from an object?
I’m trying to get a value of an instance
for eg.

ListOfPpl newListOfPpl = new ListOfPpl(id, name, age);
Object item = newListOfPpl;

How can I get a value of name from an Object item??
Even if it is easy or does not interest you can anyone help me??

Edited: I was trying to build a binary tree contains the node of ListOfPpl, and need to sort it in the lexicographic. Here’s my code for insertion on the node. Any clue??

    public void insert(Object item){
    Node current = root;
    Node follow = null;
    if(!isEmpty()){
        root = new Node(item, null, null);
        return;
    }boolean left = false, right = false;
    while(current != null){
    follow = current;
        left = false;
        right = false;
                      //I need to compare and sort it
             if(item.compareTo(current.getFighter()) < 0){
                                 current = current.getLeft();
            left = true;
        }else {
        current = current.getRight();
            right = true;
        }
        }if(left)
            follow.setLeft(new Node(item, null, null));
        else
            follow.setRight(new Node(item, null, null));
    }
  • 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-15T04:47:21+00:00Added an answer on May 15, 2026 at 4:47 am

    Since your item variable is declared to be of the most basic Java type Object, you can’t extract anything related to your data from it directly. The variable newListOfPpl, on the other hand, which is a reference to the same object, is declared to be of type ListOfPpl, so you can invoke on it whatever getter methods that have been defined in it (possibly getId(), getName(), getAge()).

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

Sidebar

Ask A Question

Stats

  • Questions 545k
  • Answers 545k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I don't see any way to do so in the… May 17, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer SELECT * FROM [makes$] WHERE [Corporate Name]='Champion Enterprises, Inc.' May 17, 2026 at 8:45 am
  • Editorial Team
    Editorial Team added an answer I think you may find use of InternetGetLastResponseInfo which is… May 17, 2026 at 8:45 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

How can I get all items from a specific calendar (for a specific date).
Ok, if I have this right, my code can get cookies at a specific
How can I get a PHP function go to a specific website when it
I can get easily see what projects and dlls a single project references from
I can get the executable location from the process, how do I get the
I can get a list of running threads from Process.GetCurrentProcess().Threads, but I need to
I can get both System.Net.Mail and System.Web.Mail to work with GMail, but I can't
Logging can get complicated, quickly. Considering that you have some code, how do you
I can get simple examples to work fine as long as there's no master
I can get the element like this $(#txtEmail) but I'm not sure how to

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.