This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes JavaBeans are similar to Header files in c/c++ ?? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "JavaBeans are similar to Header files in c/c++ ??" Watch "JavaBeans are similar to Header files in c/c++ ??" New topic
Author

JavaBeans are similar to Header files in c/c++ ??

Anil Jain
Ranch Hand

Joined: Mar 10, 2002
Posts: 51
I am new to Java programming. From what I read about javabeans it seems they are similar with .h files of c++. That is you write the functions and use these functions anywhere by just including that header file.
Correct me if my wrong
Thanks,


Anil Jain<br />Sun Certified Java(2) Programmer
Roy Ben Ami
Ranch Hand

Joined: Jan 13, 2002
Posts: 732
No Amit.... Java Beans are unlike the header files at all.
Java Beans are more like COM if you want to compare to c++ world.
Java Beans are just regular java classes that follow a few rules like: they have to have an empty constructor, and a set and get methods for private variables....
there is no equivalent for header files in java (interfaces come close though) cause in java there is no distinction between the declaration of a class and its implementation.
Anil Jain
Ranch Hand

Joined: Mar 10, 2002
Posts: 51
Roy!!
Thanks again for correcting me and providing me useful info.
Appreciate that.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaBeans are similar to Header files in c/c++ ??
 
Similar Threads
running JNI on eclipse
Accessing js-functions of a header
J2ME & BIOS functions
Including External files......?????
DOUT ON PACKAGES.