Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Java passing arguments (type error)

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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
In this post we will learn different types of Android Layout and some basics of an Android App.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
Suggested Courses

618 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