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
String problem
Stephen Foy
Ranch Hand
Posts: 143
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Any ideas why this wont work, it doesnt assign the value "123..." to the cell location when it should
public static void dynVal() { for(int i = 1; i < 9;i++) { for(int k = 1;k < 9;k++) { if(String.valueOf(cells[i][k]) == "0" || String.valueOf(cells[i][k]) == null) cells[i][k] = "123456789"; } } }
Stephen Foy - Microsoft Application Development Consultant
Ernest Friedman-Hill
author and iconoclast
Posts: 24207
46
I like...
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Don't compare Strings using ==; use the equals() method. == compares for physical object identity; equals() compares for equivalence.
[Jess in Action]
[AskingGoodQuestions]
Stephen Foy
Ranch Hand
Posts: 143
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Thanks, silly mistake
Stephen Foy - Microsoft Application Development Consultant
sun cheng
Greenhorn
Posts: 17
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Agree with above floor
stephen shields
Greenhorn
Posts: 20
posted 17 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
you can also use the compareTo() method,which is wat i was taught to use.
what ever works
Without subsidies, chem-ag food costs four times more than organic. Or this 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
There is no main method in class: Times - How do I resolve it?
calculator program help please
Can you make java program into GUI?
Messy Problem - String.replaceAll()
Game Tutorials -->> TicTacToe
More...