Flat Preloader Icon

Interviews programs

Java Program to print Hello World string on screen In this java program, we are printing “Hello World” string using println method (System.out.println()). println method is used to print a line on screen. package com.tcc.java.programs; /** * Java Program to Print Hello World on Screen */ public class HelloWorld { public static void main(String[] args) … Read more

Interview Questions Core Java

1. What is the difference between JDK, JRE, and JVM? Answer: The JDK (Java Development Kit) is a software package that includes the tools necessary for Java development, such as the Java compiler and debugger. The JRE (Java Runtime Environment) is a subset of the JDK, containing only the runtime components required to run Java … Read more

JDBC

JDBC is a vital part of Java development when dealing with databases. It provides a standardized way to connect to and manipulate data in relational databases, making it an essential tool for building robust and data-driven Java applications. Overview What is JDBC? Type of Drivers Steps to access Connection Statement CRUD operations Prepared Statement Callable … Read more

Java Reflection

Overview What is Java Reflection? Class Object Constructors Fields Methods Annotations What Is Java Reflection? Powerful and helpful feature which helps to inspect the classes, interfaces, methods etc, at runtime without knowing about these at compile time. E.g. Methods[] m = testObject.getClass().getMethods() Class Object JVM creates a class object for all the objects of that … Read more

Java Annotations

Overview What are Annotations? Use of Annotations Annotations Placements Built in Java Annotations Custom Annotations What Are Annotations? Metadata about the java code. Introduced from Java 5 Mostly do not effect the code execution, sometimes they might. E.g. @Override Use of @ points to the compiler that it is an annotation. Use of Annotations Compilers … Read more

Java I/O

Overview Input/Output Streams Byte Oriented Streams Character Oriented Streams Object Serialization Channel Based I/O Input/Output Streams Stream is an abstraction and can be thought of as flow of data from source to sink. Source or InputStream initiates the flow of data. Sink or OutputStream terminates the flow of data. There is no concept of index … Read more

Java Generics

Overview Java Generic Features Generic List in Java Generic Map in Java Java Generic Classes & Methods Java Generic For Loop Generic WildCard Java Generics Java Generics was introduced in Java 5 to deal with type-safe objects. Using generics a programmer can force to store a specific type of objects in collection E.g. List list … Read more

Sets & Queues

Set Interface Set is a collection of unique objects and it does not allow duplicates. HashSet implementation uses hashtable for storing these objects. LinkedHashSet implementation uses linked list for storing these objects. Insertion/Delete thus, are fast here. TreeSet implementation uses a tree for storing these objects in sorted order. Hence searching is fastest here. Types … Read more

Collections

Overview What is Collections Framework? Key interfaces of Collections Framework Comparable & Comparator Lists Maps Sets Queues The Collections Framework is a core part of the Java Standard Library (Java API) that provides a comprehensive set of interfaces, classes, and algorithms to work with collections of objects. It was introduced in Java 2 (J2SE 1.2) … Read more

Synchronization & Thread Interaction

Synchronization and thread interaction are crucial aspects of multi-threaded programming in Java. These concepts are used to coordinate the activities of multiple threads and ensure that they access shared resources in a safe and controlled manner Synchronization in Java Synchronization in Java is primarily achieved using the synchronized keyword, which can be applied to methods … Read more