Java MiB problem

in python.hello world code is 5 MiB and very quick.But in java.Hello world code is 71 MiB and very slower than python or another language.Is it a problem.If it isnt, why?

1 Like

Welcome to Ask @cagankocabas35!

This is not a bug, as it it just how languages work.
Java has more unneeded content that Python does, therefore more bytes.
Python:

print("Hello, world!")

Java:

class Main {
    public static void main(String[] args) {
        System.out.println("Hello, World!"); 
    }
}
4 Likes

but when I write a longer code in c,Its even 1 MiB. and the code have more things than hello world code in java

This is because C is a pretty simple language and multiple have been written from it making it slower since they use Compilers from C, such as Python and parts of Java. I hope this helps!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.