0% found this document useful (0 votes)
7 views2 pages

Java Threads, Streams, and JavaFX Explained

Uploaded by

fokowe2429
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views2 pages

Java Threads, Streams, and JavaFX Explained

Uploaded by

fokowe2429
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1. What do you mean by threads in Java?

A thread in Java is the smallest unit of a program that can run independently. It represents a lightweight
subprocess and enables multitasking by allowing multiple parts of a program to run concurrently.

2. Give the difference between process and thread.

Process vs Thread:

- Process: Independent executing program with its own memory space, heavyweight, slow
communication, crash doesn’t affect others.

- Thread: Sub-part of a process sharing the same memory, lightweight, fast communication, crash may
affect whole process.

3. What is stream?

A stream in Java is a sequence of data (bytes or characters) that supports input and output operations.

4. List the byte stream classes.

Input Byte Streams: FileInputStream, ByteArrayInputStream, FilterInputStream, BufferedInputStream,


DataInputStream.

Output Byte Streams: FileOutputStream, ByteArrayOutputStream, FilterOutputStream,


BufferedOutputStream, DataOutputStream.

5. Enlist the two common constructors of FileInputStream.

- FileInputStream(String fileName)

- FileInputStream(File file)

6. What is the need of Generic Programming?

Generic programming is needed to enable type safety, avoid ClassCastException, allow code
reusability with parameterized types, and improve readability and maintainability.

7. What are various features of JavaFX?

Features: Rich UI controls, CSS styling support, FXML, 2D/3D graphics, animation and media support,
hardware acceleration, easy Java integration.

8. Which method is used to launch JavaFX application?

The launch() method from the Application class.

9. Define event source object.


An event source object is the component that generates an event and sends it to listeners.

10. Define property binding in JavaFX.

Property binding allows one UI component’s property to automatically update when another changes.

You might also like