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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T01:15:19+00:00 2026-06-10T01:15:19+00:00

How to get the individual value of a public static list //get value error

  • 0

How to get the individual value of a public static list

//get value error
Console.WriteLine(lbl_test.module_a.moduleoutput[0]);


public static List<string> moduleoutput()
{
    List<string> output = new List<string>();
    output.Add("test 1");
    output.Add("test 2");
    output.Add("test 3");
    return output;
}

Error:
Cannot apply indexing with [] to an expression of type ‘method group’

  • 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-10T01:15:21+00:00Added an answer on June 10, 2026 at 1:15 am

    You need to get the list first before you can access it by the indexer. So the method call is missing(the parentheses). moduleoutput is a method not a variable.

    Console.WriteLine(lbl_test.module_a.moduleoutput()[0]);
    

    Search for Method Access here: http://msdn.microsoft.com/en-us/library/ms173114.aspx

    Calling a method on an object is like accessing a field. After the
    object name, add a period, the name of the method, and parentheses.
    Arguments are listed within the parentheses, and are separated by
    commas.

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

Sidebar

Related Questions

Relatively new to MVC and trying to get a cascading dropdown list working for
I can get individual uncompressed frames from the iPhone's camera in iOS4. What i
Is there a way to get individual ant tasks to run quietly? I know
I have a Unix timestamp that I need to get the individual year, month,
I'm wondering if it's possible to get the address of an individual element of
In Spring MVC, I can do this to get a value of items on
I have this class: public class TextFiller { public HtmlText Text { get; set;
I currently have this function: public double Max(double[] x, double[] y) { //Get min
I am trying to parse a JSON string in java to have the individual
My action: public function executeEdit(sfWebRequest $request) { // Get the object $article = $this->getRoute()->getObject();

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.