Not sure what your point is here. Is there a question?
JamesCherrill
... trying to help
8,667 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,476
Skill Endorsements: 33
import is just a way to simplify referring to classes. You can write
javax.swing.JFrame myFrame = new javax.swing.JFrame();
... but that gets very tedious, so you import javax.swing.* then you can just refer to JFrame and the compiler knows where to find it.
extends is completely different - that says that your class will inherit variables and methods from the parent class.
JamesCherrill
... trying to help
8,667 posts since Apr 2008
Reputation Points: 2,636
Solved Threads: 1,476
Skill Endorsements: 33
but in c++ we use <iostream.h> and <conio.h> where we use cin and cout from these libraray functions but we dont inherit anything .we use normally we dont write like class base:public derieved there is no inheriting property
Yes, you can write OO programming in C++ as well. Even though, C++ is not really designed for OO programming, you should be able to do it. I had to write code that way all the time in school -- create a class and use it in another class or program. In C++, inheritant is not explicit. In other words, you have to do some work around, but you could still produce similar effect as inherited class (for both extends & implement). Not intuitive but possible.
When you use include <iostream.h>, it is similar to Java "import java.lang" but you don't explicitly do it in because Java automatically includes that library (for standard IO -- System).
Taywin
Posting Maven
2,633 posts since Apr 2010
Reputation Points: 275
Solved Threads: 376
Skill Endorsements: 17