C++/C++ header files
I have knowledge on how to program in java and have been trying to learn c++ over the internet. when i came across header files in c++ i got confused in how to properly create them since you dont create them in java. From my understanding, they are used as an interface to show other classes that use the class what variables and methods are availble for them to use, but im confused in whether you have to declare variables and methods that are private in the header file, since other classes cant use them.
A header file is basically just a way of splitting (mostly) the declarations from the implementations (there are exceptions, hence my mostly parenthetical). You will declare a class and all of its functions and variables in a header file, even private ones.
Don't think of private functions and variables as strictly private. There are circumstances where protected and private functions and variables can actually be accessed. Friend classes can access both private and protected items, and child classes can access protected items (but not private).
I mentioned earlier that there are exceptions to the rule of "declare in header, implement in CPP." These exceptions come in a couple of forms. One is inline functions. Inline functions are generally implemented right in the header file. They are (or should be) small functions, only a line or two, so it generally doesn't clutter the file too much. Many accessors, even non-inline ones, are often written directly in the header, as well. The other exception is template classes (which you can worry about when you're further along in your C++ studies). Template classes must be entirely implemented within the header, unless a particular keyword is supported; a keyword which I cannot even remember at the moment because it is so rarely supported... just assume that a template is always implemented in the header with no CPP file allowed.
I hope this helps clear up your confusion about header files. Coming from Java to C++ is not quite as easy as from C++ to Java, I think. At least, that's my opinion. The two are extremely similar, though, so I don't suspect you will have much difficulty. I wish you luck in your studies and I am always here to answer any questions you may have.