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
non zero value
John Valiant
Greenhorn
Posts: 26
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can anyone give me an example on how to initialise a non zero value using array?
Jeff Verdegan
Bartender
Posts: 6109
6
I like...
posted 12 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
John Valiant wrote:
Can anyone give me an example on how to initialise a non zero value using array?
What do you mean? Are you talking about initializing the elements of an array to non-zero values? If so, you can do one of the following:
int[] arr = {1, 2, 3};' // OR int[] arr = new int[] {1, 2, 3}; // OR int[] arr = new int[3]; for (int i = 0; i < arr.length; i++) { arr[i] = something; }
If that's not what you're talking about, you'll need to clarify your question.
Do not meddle in the affairs of dragons - for you are crunchy and good with ketchup. Crunchy tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Clarification about the static method System.exit(0)
Shoud I get a null?
System.exit() capture using bat or shell script
Array output continuous in output window and won't terminate - Any help!!
JFreeChart design issue
More...