python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Why do we need constants in Rust if we have immutable variables?
So I'm exploring Rust, and I have read about technical differences between constants and immutable variables. But it seems like immutable variables can do all things that constants can. Then what is t...
Oleksandr Novik
Votes: 0
Answers: 3
TypeScript immutable data/classes with mutual reference
Usually when I create a TypeScript application I follow an OOP + immutable data philosophy.
So let's suppose I have two classes with mutual reference, class A and class B.
class A {
public readonl...
Vasile Alexandru Peşte
Votes: 0
Answers: 1
Console assigns different IDs to identical immutable objects
I'm using Python 3.10.1. When I run the following code as a .py file, it prints True:
a = (1, 2)
b = (1, 2)
print(a is b)
However, when I type the same lines of code into the interactive Python conso...
Ron Inbar
Votes: 0
Answers: 1
Why lower bound(<? super T>) is mutable and upper bound not (<? extends T>) in Java
I'm trying to understand Java Generic so I ended up with not able to understand why lower bound type can be mutable and upper bound types not.
The example I have:
List<? extends String> upperBou...
Ahmad Alhaj-Karim
Votes: 0
Answers: 0