Solved

Java passing arguments (type error)

Posted on 2016-10-30
2
70 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 34

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 16

Accepted Solution

by:
krakatoa earned 500 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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone 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

Suggested Solutions

Title # Comments Views Activity
iterator/ListIterator approach 17 65
Unhandled exception type Exception 18 63
jsp login check 12 62
glassfish admin console 1 45
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Suggested Courses

738 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