JAVASISTAHS WHAT THE ACTUAL KEK IS THIS?!?!?!!!
>programming LANGUAGE>forced to use incomprehensible symbol/operator-babble instead of using actual languageC syntax is shit and designed purely to gatekeep.
>>109612644It makes sense.
>>109612644learn the difference between int and Integer, saar. although soon (tm) this will be solved by value classes.still you should never use == for objects.
>>109612695>=>Incomprehensible symbolBurger or spiritually burger
>>109612710Yes a=b means equals. So how come if(a=b) is always true unless b is 0? Bug in the language.
>>109612644a and b are references. This is literally on the first page of the first chapter of Babby's First Java Tutorial.
>>109612721>Bug in the language.Can't argue against that.
>>109612735no they're integers
>>109612794They're references to instances of the Integer class. They're references; a == b is compares pointers, not their underlying values.
>>109612695>>109612721>>109612744>a=b means equals= is for assignment. == is for equality.>if(a=b)Not valid in Java. And a=b evaluates to b in CThere is no bug to be seen
>>109612840not they're not
the absolute state of /g/: arguing about the basic semantics of a boomer programming language. You old people will all die alone and then finally this place will live again.
>>109612846>if(a=b)This will not work, because a=b is an assignment statement, and assignment statements have no return value>if((a = b))This will in theory assign a to b, creating an expression that returns a. But the expression inside the if-statement must be of type boolean (or un-boxable to a boolean), there is no truthiness in java.>>109612908Taking the bait: because a and b are of type Integer, are definitely a reference. Integer is the wrapper type of primitive ints, with added syntactic sugar to allow for arithmetic operations to be done to them.The Integer class is immutable and keeps a cache of Integer objects for int values 0 to 256 I believe, so Integer#valueOf does not need to instantiate a new object for common values. This is why a check for reference equality (==) is advised against when comparing the values an Integer object carries.>>109612908You truly are a nigger.
>>109612644SAAR JAVA BEST!YOU ARE LOW BRAIN IQ NO UNDASTAND JAVA HAHAHAHAHA-1000 IZZAT
>>109612644First test would pass since all Integer objects between -127 and 128 are cached you filthy nigger faggot
>>109612644object a = 100;object b = 100;Console.WriteLine(a == b); // Falseit's over for .NETsirs
object a = 100;object b = 100;Console.WriteLine(a == b); // False
>>109612644For me I prefer this:let a = 100;let b = 100;if (a.equals(b)) while true do { console.writeln("try your best to stay alive");}
let a = 100;let b = 100;if (a.equals(b)) while true do { console.writeln("try your best to stay alive");}
I'm a transgender woman by the way, if that matters
>>109613263no matter how many times you put my name and calculated tripcode into the name field, it won't make you me. you would have to enter my name and my passcode into the name field, like username#password to be valid. however, i am definitely a transwoman regardless.
this is why python is the best followed by typescript
>>109612644>JAVASISTAHS WHAT THE ACTUAL KEK IS THIS?!?!?!!!most languages differentiate between value and reference types. one of the bigger mistakes of java was to expose those value types, sure it made the jvm more efficient but led to some pretty retarded shit down the line
>>109612644rustroon thread
>>109613371idk it just works on dotnet DOE
>>109612644Integer != int