16 June 2025

#Generics

#Generics
What are generics in Java?
Why are generics used in Java?
What is the syntax for declaring a generic class?
What is the syntax for declaring a generic method?
What are the benefits of using generics?
Can you use primitives with generics?
What is type erasure in Java generics?
How do you create a generic class?
Can you have multiple type parameters in a generic class?
What are raw types in generics?
What is the difference between List and List?
What is the wildcard ? in Java Generics?
Explain bounded type parameters.
Difference between extends and super in generics.
Can we use generics with arrays?
Why is it not allowed to create an array of generic type?
How does generics affect polymorphism?
What are generic methods? Provide an example.
Can a generic method be static?
How do generics work at runtime?
What is the PECS principle (Producer Extends Consumer Super)?
What are the limitations of Java Generics?
Explain the concept of generic type inference.
How is type safety ensured using generics?
Can you override a method with different generic parameters?
How is generics implemented in Java internally?
Can you use instanceof with generics?
Can you create a generic enum or generic exception class?
What are the differences between generic and non-generic collections?
How does Java handle backward compatibility with generics?
Explain this code: public void show(T t).
What would happen if we use raw types with generics?
Why are generic types not reified?
What is the output of this generic method code snippet? (Give a specific code).
What are the implications of type erasure?
Can you overload methods with different generic return types?
How to create a generic singleton class?
Is it possible to restrict generics to certain classes/interfaces only?
When should you use wildcard generics in method arguments?
Can you assign List to List and vice versa?
Would you like answers or code examples for any of these questions? Or would you like 100+ questions in a PDF format?
What are generic interfaces? Can you provide an example?
Can we have a generic constructor in a non-generic class?
Can we use a generic class without specifying type?
What is the difference between generic class and generic method?
What are the rules for using multiple bounds in generics?
What is the default upper bound of a generic type in Java?
What are the risks of using raw types?
Can we instantiate a generic type at runtime?
How does autoboxing work with generics?
Can you use generics with throws clause in exceptions?
What is a generic factory pattern?
How can generics be used in DAO (Data Access Object) design?
How would you write a type-safe generic comparator?
How can generics be used with reflection?
What is a generic recursive type bound?
Can you have nested generic types like Map>?
What are covariant and contravariant types in generics?
How do you resolve ?unchecked cast? warnings with generics?
What is the effective use of generics in custom collections?
How can you write a type-safe generic builder class?
Why is List not a supertype of List?
Can we create a generic array in Java?
Explain this declaration: Class clazz.
Can generic classes extend or implement other generic classes?
Can we write T[] in a generic method or class?
Why does this code fail: T t = new T();?
What are reifiable and non-reifiable types?
How do generics differ from templates in C++?
What is the purpose of @SuppressWarnings("unchecked")?
How are generic types handled by the JVM?
When should we use unbounded wildcard ?
When should we use ?
When should we use ?
How do wildcards affect method overriding and overloading?
Can you assign List to List?
Why are wildcard captures necessary in some generic code?
Can you use a wildcard as a return type?
What does "capture of ?" mean in compiler errors?
Write a generic method to copy elements from one list to another.
Why does the following code give a compilation error? (Insert code with List list = new ArrayList();)
Can we overload generic methods with different type parameters?
Can we pass a generic method as a parameter?
How do bounded type parameters affect method signatures?
What is the difference between T and E in generics? Are they interchangeable?
Can you use generics with lambda expressions?
How can we sort a List using a generic comparator?
Can you override a generic method in a subclass?
Can you use generic classes in annotations?
How does the Java compiler check for generic type safety?
What tools help detect generic misuse (e.g., static code analyzers)?
How are generics used in the Java Collections API?
How does Java handle generic bytecode?
What are best practices when using generics in library APIs?
How are generics used in popular libraries like Guava or Spring?
When would you choose to not use generics?
Can generic types improve code readability or make it worse?
How do generics affect serialization?
Can generic parameters extend more than one class/interface?
What are F-bounded polymorphism and where is it used?
  • Java Generics - Benefits
  • Generic Class, Interface Syntax , Generic Methods
  • Type Erasure
  • Raw Types and Their Limitations
  • Bounded Type Parameters (extends and super)
  • Wildcard Types in Generics (?, ? extends, ? super)
  • PECS Principle (Producer Extends, Consumer, Super)
  • Type Safety and Compile-Time Checking
  • Generics and Polymorphism
  • Generics with Collections Framework
  • Restrictions and Limitations of Generics
  • Generic Constructors
  • Generic Inheritance and Subtyping
  • Multiple Type Parameters
  • Generics and Reflection
  • Unchecked Casts and SuppressWarnings
  • Generics vs Arrays

13 June 2025

#Java_IO

#Java_IO
What is Java I/O?
What is the difference between byte stream and character stream in Java?
What is the purpose of the java.io.File class?
How does BufferedReader improve performance?
What is the difference between FileReader and BufferedReader?
What is the difference between InputStream and Reader?
What is the use of InputStreamReader and OutputStreamWriter?
How do you serialize an object in Java?
What is the role of transient keyword in serialization?
What happens if a non-serializable object is part of a serializable class?
What is the purpose of serialVersionUID?
How can you read a file line-by-line in Java?
What is the use of DataInputStream and DataOutputStream?
How does ObjectOutputStream work?
What are the standard streams in Java?
What is the difference between FileInputStream and FileReader?
How do you handle exceptions in Java I/O?
What is RandomAccessFile?
What is stream chaining in Java I/O?
How do mark() and reset() methods work in input streams?
What is the use of PushbackInputStream?
Can we use Java I/O in multithreaded applications?
How do you copy a file using Java I/O?
How do you ensure a stream is properly closed?
What are the limitations of traditional Java I/O?
What are the main classes in the java.io package?
Explain the difference between BufferedInputStream and BufferedOutputStream.
How does buffering improve I/O performance?
What is the use of PrintWriter in Java?
Can you write binary data using PrintWriter? Why or why not?
Explain the decorator pattern in the context of Java I/O.
What are the drawbacks of Java I/O?
What is a stream in Java I/O?
How many types of streams are there in Java?
What is the difference between flush() and close() methods in streams?
What is the difference between read() and readLine()?
What happens when you call close() on an already closed stream?
What is EOFException in Java I/O?
Explain the difference between FileOutputStream and ObjectOutputStream.
How does ObjectInputStream read objects?
What are the limitations of Java's serialization mechanism?
What is Externalizable and how is it different from Serializable?
What are transient and volatile in Java I/O context?
What is the difference between File.delete() and File.deleteOnExit()?
How do you read/write a UTF-encoded file in Java?
What is the use of FileDescriptor?
How can you check if a file exists before reading it?
How to list all files in a directory using Java?
Can you read from multiple files at once in Java?
What does File.canRead(), canWrite(), and canExecute() do?
How to check file permissions using Java?
What is the difference between Reader and InputStreamReader?
What is the use of LineNumberReader?
How to implement custom serialization in Java?
How can you make a class serializable but skip some fields?
How does Java handle circular references during serialization?
Can you override default serialization behavior?
How to serialize a list of custom objects?
How to write logs using Java I/O?
Can you read a file without loading the whole content into memory?
What is the use of SequenceInputStream?
Explain FilterInputStream and FilterOutputStream.
What is the difference between flush() and write()?
What happens if the output stream is not flushed before closing?
What are file channels and how are they different from streams?
Explain the use of BufferedReader.mark() and BufferedReader.reset().
What is the default buffer size used in buffered streams?
Why would you prefer PrintWriter over BufferedWriter?
Can you serialize static members?
Write code to read a file and count the number of lines.
Write code to find the longest line in a text file.
How would you handle large file reading in Java?
How to append to an existing file?
How to check file size using Java?
How to read a properties file using Java I/O?
How to write logs with timestamps to a file?
How to detect file encoding in Java?
How to monitor file changes in Java I/O?
How do you read from a zip file using Java I/O?
Explain how Java handles file locks.
How to handle encoding issues when reading files?
What are character encodings supported by Java I/O?
How to work with temporary files in Java?
Explain File.createTempFile() method.
What is a memory-mapped file in Java?
How is performance affected when using unbuffered I/O?
What is the use of File.listFiles(FileFilter)?
How does Java handle symbolic links?
What is the impact of GC on open streams?
How to unit test file reading methods?
What are the best practices for closing streams?
Why is try-with-resources preferred?
Can streams be reused once closed?
Is Java I/O thread-safe?
How to avoid memory leaks in I/O operations?
How to handle IOException cleanly?
How to wrap a stream with custom logic?
What is the use of File.renameTo()?
What?s the difference between BufferedWriter and PrintWriter?
Why is Serializable a marker interface?
  • Java I/O is stream-based
  • Byte streams (InputStream, OutputStream)
  • Character streams (Reader, Writer)
  • File class
  • BufferedReader/BufferedWriter or BufferedInputStream/BufferedOutputStream
  • ObjectInputStream/ObjectOutputStream
  • DataInputStream/DataOutputStream
  • PrintWriter and PrintStream
  • BufferedReader & InputStreamReader &
  • FileInputStream & FileOutputStream
  • FileReader/FileWriter
  • try-with-resources
  • Java I/O is blocking (synchronous)
  • RandomAccessFile
  • IOException.
  • OutputStreamWriter
  • BufferedReader.readLine()
  • File.separator
  • available()
  • PushbackInputStream and PushbackReader
  • file.canRead() or file.setWritable()
   Stream   

#Serialization

#Serialization
What is Serialization in java?
What is the Marker interface?
What is serialVersionUID?
What will happen if the reference variable is not serializable?
What will happen if a class is serializable but its superclass does not?
What are the most important classes and interfaces using the Serialization?
Why do we need to use Serialization in java?
Why the Serializable interface is called the Marker interface in Java?
How can we implement Serialization in java?
How can we restrict some variables to be serialized?
How to serialize an ArrayList?
When we should use Externalizable interface in Java?
In singleton design pattern serialization becomes an issue, how you will overcome this?
Can you customize the serialization process? How can you achieve this?
Describe the De-serialization process.
Describe the benefits of serialVersionUID.
Describe the methods of serialization and deserialization process.
Do static variables participate in serialization?
Find out the difference between Serialization and Externalizable?
Suppose parent class of a new child class implement Serializable interface, how can you avoid new child class to being serialized?
  • Serializable Interface
  • Marker interface
  • Transient Keyword
  • Static Fields and Serialization
  • serialVersionUID
  • Custom Serialization using writeObject() and readObject()
  • Serialization and Inheritance
  • Deserialization Process
  • NotSerializableException
  • Deep vs Shallow Serialization
  • Serialization in Java Collections
  • Serialization Alternatives (e.g., Externalizable, JSON, XML)

#CoreJava_22

#CoreJava_22
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0744' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_21

#CoreJava_21
String Templates (Preview)
Sequenced Collections
Generational ZGC
Record Patterns
Pattern Matching for switch
Foreign Function & Memory API (Third Preview)
Unnamed Patterns and Variables (Preview)
Virtual Threads
Scoped Values (Preview)
Vector API (Sixth Incubator)
Deprecate the Windows 32-bit x86 Port for Removal
Prepare to Disallow the Dynamic Loading of Agents
Key Encapsulation Mechanism API
Structured Concurrency (Preview)
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0310' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_18

#CoreJava_18
UTF-8 by Default
Simple Web Server
Code Snippets in Java API Documentation
Reimplement Core Reflection with Method Handles
Vector API (Third Incubator)
Internet-Address Resolution SPI
Foreign Function & Memory API (Second Incubator)
Pattern Matching for switch (Second Preview)
Deprecate Finalization for Removal
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0307' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_17

#CoreJava_17
Restore Always-Strict Floating-Point Semantics
Enhanced Pseudo-Random Number Generators
New macOS Rendering Pipeline
macOS/AArch64 Port
Deprecate the Applet API for Removal
Strongly Encapsulate JDK Internals
Pattern Matching for switch (Preview)
Remove RMI Activation
Sealed Classes
Remove the Experimental AOT and JIT Compiler
Deprecate the Security Manager for Removal
Foreign Function & Memory API (Incubator)
Vector API (Second Incubator)
Context-Specific Deserialization Filters
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0306' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_16

#CoreJava_16
Java 16
Topic SubTopic
Vector API (Incubator)
Enable C++14 Language Features
Migrate from Mercurial to Git/GitHub
Concurrent Thread-Stack Processing
Unix-Domain Socket Channels
Alpine Linux Port
Elastic Metaspace
Windows/AArch64 Port
Foreign Linker API (Incubator)
Warnings for Value-Based Classe
Packaging Tool
Foreign-Memory Access API (Third Incubator)
Pattern Matching for instanceof
Records
Strongly Encapsulate JDK Internals by Default
Sealed Classes (Second Preview)
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0199' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_20

#CoreJava_20
ViewTopicCode : select Label, BlogLink from Topic where Parent='TOP-0309' and ActiveStatus='01' order by CAST(TopicOrder AS INT)

#CoreJava_23

#CoreJava_23
What are the key features introduced in Java 23?
Explain the concept of stream gatherers introduced in JDK 23.
What is the purpose of JEP 461 ? Stream Gatherers?
How do stream gatherers improve upon traditional Java streams?
What is the structured concurrency feature in Java 23?
How does JEP 462 enhance the existing structured concurrency APIs?
What is the ScopedValue.CarrierThread introduced in Java 23?
How do scoped values differ from ThreadLocal in Java 23?
What are the enhancements in the foreign function & memory API in JDK 23?
Explain JEP 454: Foreign Function and Memory API as finalized in Java 23.
What is the Vector API and what enhancements were made in JDK 23?
How does the Vector API improve performance over scalar code?
What is the importance of JEP 460 ? Vector API (Seventh Incubator)?
What is the purpose of primitive types in patterns (JEP 457)?
How does Java 23 enhance pattern matching for switch and records?
What is JEP 463 ? Implicitly Declared Classes and Instance Main Methods?
How does Java 23 support beginner-friendly programming with implicit classes?
What is the concept of unnamed patterns and variables (JEP 456)?
How does Java 23 improve preview features for record patterns and sealed types?
What are the changes related to class-file API in Java 23 (JEP 457)?
What are the performance improvements introduced in Java 23?
How does Java 23 support green threads and virtual threads improvements?
What are some deprecated or removed features in Java 23?
What are unnamed classes and what problem do they solve in Java 23?
Explain the use of the _ (underscore) in unnamed variables and patterns.
How does JDK 23 enhance beginner-friendly coding practices?
What are the differences between structured concurrency in JDK 21 and JDK 23?
What are the use cases of Stream.collect(Gatherer.of(...)) in Java 23?
How do Stream Gatherers compare to custom collectors in terms of readability and performance?
What are the main goals of JEP 463 (Implicit Classes and Instance Main Methods)?
How is the Java compiler handling implicitly declared classes?
What changes have been made to the preview features process in Java 23?
How are features like sealed classes and record patterns further stabilized in JDK 23?
What is the impact of structured concurrency on asynchronous programming in Java?
What runtime support is added for pattern matching in Java 23?
Describe the compatibility considerations when upgrading to Java 23.
How is Java 23 improving developer productivity through syntactic sugar?
How are preview features enabled or disabled in Java 23 during compilation?
What testing strategies should be considered when using preview features like unnamed classes?
What are the compiler flags needed to use preview features in JDK 23?
How can developers prepare their codebases for future adoption of Java 23 features?
What is the current status of Project Panama as of Java 23?
How does the FFM (Foreign Function & Memory) API interact with native memory safely in Java 23?
In what scenarios should developers prefer virtual threads introduced in earlier releases with updates in Java 23?
How do the new APIs in Java 23 impact reactive and concurrent application development?
What changes have been made to improve JVM performance in Java 23?
Are there any updates or removals of legacy APIs in Java 23?
How is Java 23 helping with easier interoperation between Java and native libraries (e.g., C/C++)?
What are some backward-incompatible changes, if any, in Java 23?
How can you experiment with Java 23 preview features in IntelliJ or Eclipse?
How does Java 23 improve the Stream API's flexibility?
What is the syntax for defining a Gatherer in Java 23?
How does Java 23 support implicit class declarations for quick prototyping?
What are the potential pitfalls of using unnamed variables?
How do record patterns improve destructuring in Java?
What are the benefits of structured concurrency for multithreaded programming?
How is structured concurrency different from ExecutorService-based models?
What is the difference between ThreadLocal and ScopedValue in Java 23?
What is the life cycle of a scoped value in Java 23?
Describe a use case for the Vector API in real-time systems.
How does Java 23 improve SIMD (Single Instruction, Multiple Data) support?
What are Gatherers used for in Java streams?
How is the behavior of a gatherer different from a collector?
What improvements were made to the JVM tool interface in Java 23?
What performance optimizations are present in Java 23 GC (Garbage Collection)?
How does the FFM API in Java 23 ensure memory safety?
What changes were made to native memory segment allocation in Java 23?
What is the use of MemorySegment.allocateNative()?
How can you call a C function from Java using JDK 23's FFM API?
What are linker options in the Foreign Linker API?
How is the MemoryLayout class used in memory-safe code?
What tools are available in Java 23 for testing native function calls?
What does incubating a feature mean in Java 23?
Which APIs in Java 23 are still incubating or in preview?
How do you enable and use preview features in Maven or Gradle builds?
Can you list examples of unnamed patterns and their syntax?
What are the best practices for migrating Java 17/21 code to Java 23?
Which deprecated features should be avoided in Java 23?
What is the current status of Valhalla project in relation to Java 23?
How does Java 23 align with Project Amber's goals?
What improvements to error handling are introduced in Java 23?
Are there any enhancements in java.time or date/time APIs in Java 23?
What changes affect module system behavior in Java 23?
Is there any enhancement to serialization or deserialization APIs?
What are some changes to javac (Java compiler) in Java 23?
Are there any changes to the Java packaging tools (like jpackage) in Java 23?
How is the Java language becoming more beginner-friendly in Java 23?
What are the educational use cases of implicit main methods?
How does Java 23 affect JavaFX or GUI development?
What are the enhancements in reflection or annotations in Java 23?
Are there changes to lambda expressions or method references in Java 23?
What are Java 23?s contributions to code readability and maintainability?
How has Java 23 affected backward compatibility testing?
Are there updates to exception handling mechanisms in Java 23?
What are the new javac warnings introduced in Java 23?
How do named and unnamed patterns coexist in Java 23?
What are potential debugging challenges introduced by preview features?
What type of IDE support is needed to work efficiently with Java 23?
How do Java 23 features improve microservices and REST API development?
How does Java 23 impact modern DevOps practices?
  • Stream Gatherers (JEP 461)
  • Scoped Values (JEP 464)
  • Foreign Function & Memory API (JEP 454)
  • Vector API ? 7th Incubator (JEP 460)
  • Pattern Matching for switch enhancements
  • Record Patterns (3rd Preview)
  • Unnamed Patterns and Variables (2nd Preview - JEP 456)
  • Implicitly Declared Classes and Instance Main Methods (2nd Preview - JEP 463)
  • Structured Concurrency (2nd Preview - JEP 462)
  • Class-File API (Incubator - JEP 457)

Most views on this month

Popular Posts