Is coding in java a disadvantage when we think about the memory and time efficiency

Is coding in java a disadvantage when we think about the memory and time efficiency ?
if so then which programming language is better for acm like programming contests
i know c ,c ++ in turbo c compiler
is it advisable to change to c or c++
please anyone suggest me
thank you

It’s difficult to give a precise answer, I don’t think one is always better than the other.

Java has a bit of memory overhead but usually the speed is quite close to c++. Programming contests are usually time-constrained, so the best language will be the one with which can create 100% bug-free solutions in the least amount of time. For me that language is usually Java, but that is because I have more experience with it.

3 Likes

I agree with you, I’m also Java coder, but on CodeChef I’m getting TLE for some big inputs, while C++ works fine with same algorithm…

Don’t use Scanner

1 Like

i too have the same issue…i am familiar with java but generally it takes up a lot of memory and takes more time…