| | |
return array from a class
Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2008
Posts: 15
Reputation:
Solved Threads: 0
for example, i am accessing values from a database.. i want to store them in an array.. but my problem is i can't access my array on my jsp page..
it returns null.. my program is quite long so i hope you could help me with a simple program so that i can pattern your program with mine. thanks really..
it returns null.. my program is quite long so i hope you could help me with a simple program so that i can pattern your program with mine. thanks really..
Here is some simple code that will show you how to access private variables in a class, If this is not what your looking for let me know.
Java Syntax (Toggle Plain Text)
public class myClass{ private int[] myArray = new int[10]; //return value of specified index public int value(int indexNumber) { return myArray[indexNumber] } //returns the array to the calling object public int[] getArray() { return myArray; }
Doing what they say couldn't be done!!!!
![]() |
Similar Threads
- (reformatted) How to return Multi-Dimensional Arrays (C++)
- Return Array from C++ (C++)
- Array of Class Objects? (C++)
- How to Return Multidimensional Arrays (C++)
- Accessing functions from base class (C)
Other Threads in the Java Forum
- Previous Thread: Using Socket in Servlet
- Next Thread: substring help
| Thread Tools | Search this Thread |
addball android api applet application apps array arrays automation awt binary bluetooth businessintelligence busy_handler(null) card chat class classes client code collision component constructor crashcourse database draw eclipse error event eventlistener exception fractal free game gis givemetehcodez graphics gui html ide image input integer integration j2me java javadoc javafx javamicroeditionuseofmotionsensor javaprojects jni jpanel jtree julia linux list loop machine map method methods migrate mobile netbeans newbie oracle output parsing physics plazmic print problem program programming project radio recursion scanner screen server service set sharepoint size smart sms socket sort sortedmaps sql string swing textfield threads tree trolltech unlimited utility webservices windows





