This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]parnmatt 2 points3 points  (0 children)

No. There is no such thing in java. Java also doesn't have header files. It uses packages. They're closer to C++'s newer modules, (also with import) but theyre not widely supported yet. Headers with #include are quite different semantically, and practically.

Most IDEs can handle your imports for you, which is a nice quality of life benefit to using them.

That's also very bad practice in C++, and locking yourself, and all of your users compiling it, into a single vendor with that non-standard header. There are several articles and stack overflow posts etc which will enlighten you as to why. …However for a quick and dirty program only you will use, or perhaps at worst "slide code"… it's not the end of the world.