?
Solved

Java passing arguments (type error)

Posted on 2016-10-30
2
Medium Priority
?
86 Views
Last Modified: 2016-11-10
I have a piece of code that accepts the following:  (List<?extends Object> list)
When I call the code, I need to pass it a List, of course. However, in my code that calls it, I need to piece together the name of that list using String functions (with a String result).  But, the function I am calling needs a List, not a String.

How do pass the argument as a List when actually what I have is a String of the name of the List?
0
Comment
Question by:MarkLoveExEx
2 Comments
 
LVL 36

Expert Comment

by:ste5an
ID: 41865919
Can your rephrase your question? Why do you have to "piece together the name of the list"? Post a concise and complete example of what you have so far.
0
 
LVL 17

Accepted Solution

by:
krakatoa earned 2000 total points
ID: 41866256
You have to find the list based on its name once you've assembled that name, and then pass the found list to your method. You could keep your lists in a Map if you like.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month14 days, 23 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question