Java decompiler vs java disassembler

Question

I am preparing core java and i got following doubt

javap is dis-assembler or de-compiler? what is the difference between them? which java CLI commands are used ?

Solution

Javap is just an "informal" dis-assembler, its output gives you information about the bytecode, but is not suitable for it to be used by an "assembler", it is rather for it to be read by a human.

The traditional difference (from the C language world):

  • Compiler: compiles a relatively high-level source code to assembly language
  • Assembler: compiles assembly code to machine code

take your conclusions for "de-compiler" and "dis-assembler"

Sometimes a software that does both steps (disassemble and decompile) is also called a decompiler, but it still depends on the context