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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:05:03+00:00 2026-05-25T12:05:03+00:00

How do I get a specific element from a List ? Double[] weightArray =

  • 0

How do I get a specific element from a List ?

Double[] weightArray = {240.0, 220d, 230.0, 240.0, 250.0,220.0, 215.0, 220.0,215d,223d};
Double[] pulseArray= {72.0,74.0,75.0,76.0,72.0,78.0,62.0,78.0,76.0,73.0,73.0,79.0};
Double[] sysArray={120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0,120.0};
Double[] diaArray={80.0,80.0,80.0,80.0,80.0,80.0,80.0,80.0,80.0,80.0};

List<double[]> values = new ArrayList<double[]>();

for(int i=0; i<weightArray.length; i++){

values.add(new double[] {weightArray[0], weightArray[1], weightArray[2], weightArray[3], weightArray[4],  weightArray[5], weightArray[6], weightArray[7],weightArray[8], weightArray[9] });
values.add(new double[] {pulseArray[0],pulseArray[1],pulseArray[2],pulseArray[3],pulseArray[4],
          pulseArray[5],pulseArray[6],pulseArray[7],pulseArray[8],pulseArray[9] });
values.add(new double[] {sysArray[0],sysArray[1],sysArray[2],sysArray[3],sysArray[4],
          sysArray[5],sysArray[6],sysArray[7],sysArray[8],sysArray[9] });
values.add(new double[] {diaArray[0],diaArray[1],diaArray[2],diaArray[3],diaArray[4],
          diaArray[5],diaArray[6],diaArray[7],diaArray[8],diaArray[9] });    

}

// Does not work
//Object element =values.get(3,2);
//String s= element.toString();
//Toast.makeText(context, s.toString() , Toast.LENGTH_SHORT).show();

For example, I want to get values element 3,2, (diaArrray[1] )

  • 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-25T12:05:03+00:00Added an answer on May 25, 2026 at 12:05 pm

    How do I get a specific element from a List ?

    To get an element from a List, use the get(int) method.

    This will return your primitive double array. Then pick an element out of that array.

    double d = values.get(3)[2];
    

    Be aware of the fact that you can simply add the arrays this way:

    double[] weightArray = {240.0d, 220.0d, 230.0d, 240.0d, 250.0d, 220.0d, 215.0d, 220.0d, 215.0d, 223.0d};
    List<double[]> values = new ArrayList<double[]>();
    values.add(weightArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there a way to get a specific element (based in index) from a
I need to be able get a single specific attribute from an element with
I am trying to get a list of elements with a specific xsd type
How can I get specific number of records from nhibernate like 10 or 15
Is there a way to get a specific field name from a template with
I'm trying to get a specific asp:button onclick event to fire when I press
Googling has been difficult because I can't get results specific enough - wondering if
I have a query such that I need to get A specific dog All
I'm working on a regular expression in a .NET project to get a specific
In a .NET WinForms app, how do I get a specific drive's icon (C:\

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.