?
Solved

Java passing arguments (type error)

Posted on 2016-10-30
2
Medium Priority
?
78 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 35

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 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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses

762 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