Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Beginning Java
Next null in arrays?
Sam Bluesman
Ranch Hand
Posts: 191
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Is there anyway to find the index of the next null value in an array?
Moosey knows best
Keith Lynn
Ranch Hand
Posts: 2412
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Do you mean a way other than a loop that searches through it?
Sam Bluesman
Ranch Hand
Posts: 191
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I suppose you cold say that yes.
Moosey knows best
Keith Lynn
Ranch Hand
Posts: 2412
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
You could use an ArrayList instead of an array and use indexOf
memati bas
Ranch Hand
Posts: 85
posted 18 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Hello,
This method can be helpful for you.
public String index(String[] array) { int[] x = new int[array.length]; // maximum capacity int b = 0; String s = ""; for(int a = 0; a < array.length; a++){ if(array[a] == null){ x[b] = a; b++; s = s + a + "\t"; } } return s; }
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
updation..error..
UB find method - OR or AND
Stop reading when reached the end of file
.showInputDialog()
Rant about java Iterator interface
More...