M
M
Mamol272019-11-08 10:51:35
Java
Mamol27, 2019-11-08 10:51:35

How to use values ​​with java scanner without storing them in memory?

Hello, I solve Java problems and among them there is one type of problems in which you need to keep within a very limited amount of memory (~ 20MB).
I read data from stdin or from a file with a scanner, almost all the data read is used once, there are those whose values ​​I overwrite, they are all ints.
So, can I not save these one-time ints in memory (I mean after I used it) and indicate for others that when the value changes, the variable does not change the reference to a new memory cell, but changes the value in the current one, as in increments?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question