Oops 5
Oops 5
Here we are considering a car and a wheel example. A car cannot move without a
wheel. But the wheel can be independently used with the bike, scooter, cycle, or any
other vehicle. The wheel object can exist without the car object, which proves to be an
aggregation relationship.
To use the Scanner class, create an object of the class and use any of the available
methods found in the Scanner class documentation. In our example, we will use
the nextLine() method, which is used to read Strings:
Java I/O:
InputStream: Java application uses an input stream to read data from a source; it may
be a file, an array, peripheral device or socket.
Swing: It is a part of Java Foundation Classes (JFC) that is used to create window-
based applications. It is built on the top of AWT (Abstract Windowing Toolkit) API and
entirely written in java. The Java Foundation Classes (JFC) are a set of GUI
components which simplify the development of desktop applications.