Jump to content

I still can't get over the fact...

Started by Bitz , Mar 12 2015 07:39 PM

  • This topic is locked
6 replies to this topic

#1

Bitz
  • Bitz
  • Best Filly
  • Web Admin
  • -1334 posts
  • IGN:BitzLeon

...That Strings are objects in java. It seems so odd. Just spent 10 minutes trying to debug why 

(inType == "value") was returning false.

Derp. 

 

I am not a smart Java. 


  • 0

#2

Crystal Bell
  • Crystal Bell
  • Plugin Developer
  • Crystal Mare
  • 258 posts
  • IGN:Crystal Bell

...That Strings are objects in java. It seems so odd. Just spent 10 minutes trying to debug why 

(inType == "value") was returning false.

Derp. 

 

I am not a smart Java. 

 

use .equals for value comparison, unless it's a primitive.

== is object equality.

 

There is also a difference between int and Integer, one is primitive and another is objects. While auto(un)boxing makes it so you can use both, == will still fail with that.


  • 0

#3

Bitz
  • Bitz
  • Best Filly
  • Web Admin
  • -1334 posts
  • IGN:BitzLeon

use .equals for value comparison, unless it's a primitive.

== is object equality.

 

There is also a difference between int and Integer, one is primitive and another is objects. While auto(un)boxing makes it so you can use both, == will still fail with that.

Yeah, i learnt this on my own with some testing. 


  • 0

#4

Crystal Bell
  • Crystal Bell
  • Plugin Developer
  • Crystal Mare
  • 258 posts
  • IGN:Crystal Bell

Yeah, i learnt this on my own with some testing. 

Do you even pointers


  • 0

#5

Bitz
  • Bitz
  • Best Filly
  • Web Admin
  • -1334 posts
  • IGN:BitzLeon

Do you even pointers

uwot


  • 0

#6

Matthew Gray v2.0
  • Matthew Gray v2.0
  • Witch/Wizard
  • Student
  • 40 posts
  • IGN:Matthew Gray

My brain just exploded
  • 1

#7

Crystal Bell
  • Crystal Bell
  • Plugin Developer
  • Crystal Mare
  • 258 posts
  • IGN:Crystal Bell

My brain just exploded

MTG-ThreadNecromancer_3198.jpg


  • 0


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users