Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #27983 > unrolled thread
| Started by | 245dav@gmail.com |
|---|---|
| First post | 2014-04-08 01:06 -0700 |
| Last post | 2014-04-08 08:45 -0700 |
| Articles | 5 — 3 participants |
Back to article view | Back to comp.lang.java.programmer
"A" is not equal "A"? 245dav@gmail.com - 2014-04-08 01:06 -0700
Re: "A" is not equal "A"? 245dav@gmail.com - 2014-04-08 01:12 -0700
Re: "A" is not equal "A"? Torsten Kirschner <torsten@kirschner.no> - 2014-04-08 11:29 +0200
Re: "A" is not equal "A"? 245dav@gmail.com - 2014-04-08 06:49 -0700
Re: "A" is not equal "A"? Roedy Green <see_website@mindprod.com.invalid> - 2014-04-08 08:45 -0700
| From | 245dav@gmail.com |
|---|---|
| Date | 2014-04-08 01:06 -0700 |
| Subject | "A" is not equal "A"? |
| Message-ID | <0e6833f8-f3df-4fee-af9b-bf7a025a92f1@googlegroups.com> |
I was trying to convert String Array to String A through cycle and than compare the result with String B but eventhough results were the same it returned false.
I'am working in BlueJ 3.1.0
Code is:
public boolean Method ()
{
String[] Example = {"a","b","c"};
String A = "";
String B = "abc"
for (int i = 0; i<3 ; i++)
{
A = A + Example[i];
}
if (A == B)
{
return true;
}
}
never got true...
[toc] | [next] | [standalone]
| From | 245dav@gmail.com |
|---|---|
| Date | 2014-04-08 01:12 -0700 |
| Message-ID | <56479471-54ec-44bc-b902-32fe240aadee@googlegroups.com> |
| In reply to | #27983 |
I appreciate any suggestions how to solve this
[toc] | [prev] | [next] | [standalone]
| From | Torsten Kirschner <torsten@kirschner.no> |
|---|---|
| Date | 2014-04-08 11:29 +0200 |
| Message-ID | <bqhtrmFn1qsU1@mid.individual.net> |
| In reply to | #27983 |
Den 08.04.2014 10:06, skrev 245dav@gmail.com:
> String[] Example = {"a","b","c"};
> String A = "";
> String B = "abc"
> for (int i = 0; i<3 ; i++)
> {
> A = A + Example[i];
> }
> if (A == B)
> {
> return true;
> }
http://lmgtfy.com/?q=How+do+I+compare+strings+in+Java%3F
[toc] | [prev] | [next] | [standalone]
| From | 245dav@gmail.com |
|---|---|
| Date | 2014-04-08 06:49 -0700 |
| Message-ID | <851d1e46-ae9d-4ded-8298-1f05d088c761@googlegroups.com> |
| In reply to | #27985 |
Thank you so much :)
[toc] | [prev] | [next] | [standalone]
| From | Roedy Green <see_website@mindprod.com.invalid> |
|---|---|
| Date | 2014-04-08 08:45 -0700 |
| Message-ID | <j968k915mdbltrrpba5eb02hoe6jfbsrga@4ax.com> |
| In reply to | #27983 |
On Tue, 8 Apr 2014 01:06:37 -0700 (PDT), 245dav@gmail.com wrote, quoted or indirectly quoted someone who said : > } > if (A == B) 1. variables begin with a lower case letter. 2. see http://mindprod.com/jgloss/string.html#COMPARISON -- Roedy Green Canadian Mind Products http://mindprod.com "Don't worry about people stealing an idea; if it's original, you'll have to shove it down their throats." ~ Howard Aiken (born: 1900-03-08 died: 1973-03-14 at age: 73)
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.java.programmer
csiph-web