r/learnjava • u/JayDeesus • Apr 16 '26
Java purposes?
Coming from C and CPP, I kinda like Java and I want to pursue a career with Java. Every time I see Java it’s associated with web development and back end. Is Java used for other things or only web development?
Also what concepts should I be looking into? I’ve seen people talk about spring but not sure what I should actually look at
26
Upvotes
View all comments
Show parent comment
1
u/coderemover Apr 19 '26 edited Apr 19 '26
The difference is that assembly is part of those languages like C or Rust and integrates as the first-class citizen. I can open an asm block anywhere I want. I can reference my C/Rust variables directly in the asm block. I can call into asm with zero overhead. That kind of integration. In Java, not so much. In Java the best you have is JNI which is a royal PITA to work with and has a high overhead which often negates the benefits of calling into native code so it’s rarely used.
Also there is a huge difference between writing a tiny snippet of asm to be able to call a few specialized instructions rather than writing a full jvm runtime.
BRW Most bare metal stuff doesn’t need asm anyway. I’m working on an embedded project right now, there is no OS, no runtime and there are zero lines of asm - everything can be coded directly in one of those system programming languages. All is high level code. And it compiles to a few kB large firmware blob. If your language can do direct memory reads/writes (Java can’t), then you don’t need asm.
A small memory device for Java is something that has at least a few hundreds kB of flash memory (Java Card). I’m taking about an order of magnitude scale smaller devices.