0% found this document useful (0 votes)
2 views1 page

Java Basics: Final Keyword, Arrays, and I/O

The document explains several Java concepts, including the use of the final keyword for constant variables, the javap tool for disassembling bytecode, and the declaration of 1D arrays. It also describes the Object class as the superclass of all classes and the purpose of wrapper classes in converting primitive types to objects. Additionally, it compares FileReader and FileWriter in terms of their functionality for reading and writing data from/to files.

Uploaded by

OM YADAV
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)
2 views1 page

Java Basics: Final Keyword, Arrays, and I/O

The document explains several Java concepts, including the use of the final keyword for constant variables, the javap tool for disassembling bytecode, and the declaration of 1D arrays. It also describes the Object class as the superclass of all classes and the purpose of wrapper classes in converting primitive types to objects. Additionally, it compares FileReader and FileWriter in terms of their functionality for reading and writing data from/to files.

Uploaded by

OM YADAV
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

Q1a) What is the purpose of the final keyword when applied to variables?

➡■ It makes the variable constant (value cannot be changed once assigned).

Q1b) What is the purpose of the javap tool in Java?


➡■ javap is a disassembler tool that shows bytecode and method/field details of compiled .class
files.

Q1c) How is a 1D array declared in Java?


➡■ Syntax: int arr[] = new int[5];

Q1d) What is the Object class in Java?


➡■ It is the parent (superclass) of all classes in Java. Every class directly or indirectly inherits it.

Q1e) What is a wrapper class in Java?


➡■ Wrapper classes convert primitive data types into objects (e.g., Integer, Double).

FileReader FileWriter
Reads data from files. Writes data to files.
Character-based input. Character-based output.
Returns int (character code). Writes single char/array/string.
Example: new FileReader('[Link]'); Example: new FileWriter('[Link]');

You might also like