RGGZT WBH Ju
RGGZT WBH Ju
2021:
a) Write about JVM:
execution.
to be platform-independent.
Java:
* Java is platform-independent.
C++:
* C++ is platform-dependent.
* Wrapper classes in Java convert primitive data types (like int, float) into objects (like Integer, Float).
* Provide methods to convert back from the object to the primitive data type.
* The super class in Java is used to call the constructor of the superclass.
* Can be modified.
* Cannot modify.
g) Auto Boxing:
* Auto boxing is a feature in Java that automatically converts primitive data types to their corresponding wrapper class objects.
* For example, int to Integer, float to Float.
@Override
System.out.println("Thread is running.");
t.start();
}
* Arrays in Java are used to store a collection of elements of the same datatype.
* You can create arrays of primitive data types (like int, char, double).
FileInputStream
FileOutputStream
* Data flow: Writes data from the program's memory to the file.
2022:
a) what is command line argument:
* command-line arguments are values passed to a program when it’s executed from the command line.
* they are typically used to provide input or configuration options to the program
* In Java, command-line arguments are accessed through the args parameter in the main method.
* Abstraction
* Inheritance
* polymorphism
* wrapper classes in Java convert primitive data types (like int, float) into objects (like Integer, Float)
* provide methods to convert back from the object to the primitive data type.
* The JVM has a garbage collector that automatically reclaims the memory occupied by objects.
* This prevents memory leaks and simplifies memory management for developers.
e) Difference between:
Method Overloading
* Multiple methods with the same name but different parameters exist within the same class.
Method Overriding
* A subclass provides a specific implementation for a method that is already defined in the superclass.
* Java.lang
* Java.util
* IllegalThreadStateException
// Thread's code
* MySQL Connector
* Oracle JDBC Driver
2023:
a) what are the uses of static keyword
c) Define an interface?
* An interface defines a contract of methods that a class must implement.
d) what is up-casting?
* A Jagged array is an array of arrays where each element can have different size.
* It's essentially an array where each element is another array, and those inner arrays can vary in size.
* Character stream is a sequence of characters that can be read from or written to.
* Thread prioritization assigns a priority to each thread, indicating its relative importance.
* Higher priority threads are scheduled to run before lower priority threads.
The Java.net package provides classes for network communication such as creating Sockets, handling URLs and sending HTTP requests.