Click here to Skip to main content
15,891,184 members
Home / Discussions / Java
   

Java

 
GeneralYou are pimping your article in the help section. Pin
Naruki9-Feb-09 15:30
Naruki9-Feb-09 15:30 
GeneralRe: You are pimping your article in the help section. Pin
Michael Monin13-Feb-09 7:17
Michael Monin13-Feb-09 7:17 
JokeWhen I think back to my USENET days... Pin
Naruki15-Feb-09 17:21
Naruki15-Feb-09 17:21 
QuestionNeed to add links to changing image within iframe, Is this possible? Any help greatly appreciated!! [modified] Pin
bluedog286814-Jan-09 6:04
bluedog286814-Jan-09 6:04 
Answer[Message Deleted] Pin
bluedog286814-Jan-09 8:36
bluedog286814-Jan-09 8:36 
QuestionI have problem with bookmark(Javascript) in opera.It works in other browser. Pin
bhatted13-Jan-09 14:32
bhatted13-Jan-09 14:32 
AnswerRe: I have problem with bookmark(Javascript) in opera.It works in other browser. Pin
toxcct15-Jan-09 4:24
toxcct15-Jan-09 4:24 
QuestionNeed help with parameterized class or method Pin
David Crow13-Jan-09 7:36
David Crow13-Jan-09 7:36 
I've got an Object array that holds various types of objects. I'm trying to code up some sort of parameterized class or method that will print the contents of those objects.

This array belongs to the framework, and is populated accordingly before a notification routine is called. For example, if the notification routine is called with a value of 100, I know the array contains Orange objects, if it is called with a value of 200, I know the array contains Apple objects, etc. In the notification routine, I need to call a "print" function that will print the contents of the object regardless of its type.

Here's how I am currently doing it:

case 100:
    Orange orange = (Orange) m_objectNames[0].getListObject();
    printContents(new Orange(), m_objectNames);
    break;
case 200:
    Apple Apple = (Apple) m_objectNames[0].getListObject();
    printContents(new Apple(), m_objectNames);
    break;
Is this clear as mud? My print function looks like:

public static <T> int printContents( T t, ObjectName objNames[] )
{
    for (int x = 0; x < objNames.length; x++)
        t = (T) objNames[x].getListObject();
}
The loop runs the correct number of times, but I can't figure out how to access the methods and properties of the T objects.

- DC

"Love people and use things, not love things and use people." - Unknown

"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch


AnswerRe: Need help with parameterized class or method Pin
toxcct15-Jan-09 4:28
toxcct15-Jan-09 4:28 
GeneralRe: Need help with parameterized class or method Pin
David Crow15-Jan-09 4:51
David Crow15-Jan-09 4:51 
GeneralRe: Need help with parameterized class or method Pin
toxcct15-Jan-09 4:55
toxcct15-Jan-09 4:55 
QuestionRe: Need help with parameterized class or method Pin
David Crow15-Jan-09 5:01
David Crow15-Jan-09 5:01 
AnswerRe: Need help with parameterized class or method Pin
toxcct15-Jan-09 5:04
toxcct15-Jan-09 5:04 
GeneralRe: Need help with parameterized class or method Pin
David Crow15-Jan-09 5:16
David Crow15-Jan-09 5:16 
GeneralRe: Need help with parameterized class or method [modified] Pin
Naruki9-Feb-09 15:18
Naruki9-Feb-09 15:18 
Questionneed source code for our project Pin
Lakshmi4108712-Jan-09 4:33
Lakshmi4108712-Jan-09 4:33 
QuestionHello World Java Program Pin
prithaa11-Jan-09 6:10
prithaa11-Jan-09 6:10 
AnswerRe: Hello World Java Program Pin
tamour12-Jan-09 0:49
tamour12-Jan-09 0:49 
GeneralRe: Hello World Java Program Pin
prithaa15-Jan-09 18:06
prithaa15-Jan-09 18:06 
GeneralThe best starting point tutorial... Pin
Naruki9-Feb-09 15:01
Naruki9-Feb-09 15:01 
QuestionAm i converting the code right ? Pin
tamour9-Jan-09 11:49
tamour9-Jan-09 11:49 
GeneralRe: Am i converting the code right ? Pin
itsmani27-Jan-09 22:13
itsmani27-Jan-09 22:13 
QuestionCannot access database Pin
tamour9-Jan-09 3:19
tamour9-Jan-09 3:19 
QuestionDeveloping a discussion forum using java? Pin
avvisaan8-Jan-09 4:59
avvisaan8-Jan-09 4:59 
QuestionPort address Translation Pin
bobbo886-Jan-09 5:16
bobbo886-Jan-09 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.