×
Home Discussions Write at Opengenus IQ
×
  • DSA Cheatsheet
  • HOME
  • Track your progress
  • Deep Learning (FREE)
  • Join our Internship 🎓
  • RANDOM
  • One Liner

Java

Java is a powerful and widely used programming language powering several development servers. It brought in a revolution by its feature of being platform independent which drove its wide adoption

Software Engineering

Master the use of Constructors in Java

In Java, a constructor is a block of code similar to a method which is used to initialize objects. It is called when an instance of a class is created.

Ananyashree
Software Engineering

Understand and use Static members in Java

In this article, you will learn What are static members in Java?, When to use them? and When they can be a problem? Static means only one copy exists for the entire class irrespective of the number of objects that exists for that class.

Janvi Talreja
Software Engineering

Understanding and using Access Specifiers in Java

Access specifiers are utilities/ code features that restrict the access to a particular code feature or data depending upon the source of the code requesting the access. In Java, they are private, public, protected and default.

Janvi Talreja
Software Engineering

Understanding Encapsulation in Java

Encapsulation is an object oriented programming (OOP) implementation technique where we are related data members in a single unit (class) and define member functions to allow indirect and restricted control from the user side.

Janvi Talreja
Software Engineering

Understanding Classes and objects in Java

You will understand Why we need classes?, How to define and use classes in Java?, Structure of classes in Java along with constructors and access specifiers, How to use objects in Java? and Characteristics and attributes of objects along with comparing two objects

Janvi Talreja
Software Engineering

Reading Data from Files in Java

We will explore 5 different ways of reading files in Java BufferedReader, Scanner, StreamTokenizer, FileChannel and DataInputStream. What is the role of encodings like UTF-8 in reading data in Java? Exception/ Errors you may encounter while reading files in Java

Abhinav Prakash Abhinav Prakash
Software Engineering

Creating and resolving Deadlocks in Java

The term Deadlock refers to a situation in multithreading, where two or more threads are blocked forever, waiting for each other. In Java, we use synchronized keyword to make the class or method thread-safe.The keyword ensures that only one thread can access the resource at a given point of time.

Priyanka Yadav Priyanka Yadav
Software Engineering

Switch Case in Java

A switch statement in Java allows an expression to be tested for equality against a list of values. Java SE 7 and later, the support for a String object is also available with switch case. We explore the basics of it like break, default statements and syntax rules

Yash Kumar Yash Kumar
Software Engineering

Working with Strings in Java

In Java, strings are treated as objects of class String. Strings are immutable objects which means they are constant and cannot be changed once it has been created. How to create a string in Java? Does String class has a Constructor? How to compare Strings in Java? How to search a string in Java?

Rupali Kavale Rupali Kavale
Java

Introduction to Java Server Pages (JSP)

JSP stands for Java Server Pages. It is a server side technology used for creating dynamic and platform independent web pages. JSP is the advanced version of Servlets.

Lakshmi Angadi Lakshmi Angadi
Java

Map in Java

The java.util.Map interface represents a mapping between a key and a value. The Map interface is not a subtype of the Collection interface. Therefore it behaves a bit different from the rest of the collection types.

Kavita Bisht
Software Engineering

Exceptions in Java

Java has a great and powerful mechanism to handle the exceptions so that normal flow of the application can be maintained. We explore the various types of exceptions, how it is handled by JVM and how it can be handled by users in a custom procedure.

Kavita Bisht
Java

Using Threads in Java

Java is a multi-threaded programming language which means we can develop multi-threaded program using Java. A multi-threaded program contains two or more parts that can run concurrently and each part can handle a different task at the same time

Kavita Bisht
Java

Overview of Java Servlets

Java Servlets are programs that run on a Web or Application server and act as a middle layer between a requests coming from a Web browser or other HTTP client and databases. We explored Servlet Architecture, Servlet API Hierarchy, Servlet interfaces, Servlet Life Cycle and the life cycle methods

Lakshmi Angadi Lakshmi Angadi
Java

do while loop in Java

A do-while loop is similar to a while loop, except the fact that it is guaranteed to execute at least one time. The do-while loop checks its condition at the bottom of the loop after one time execution of do and hence, is an exit control loop. It is slower than for and while loops in Java

OpenGenus Tech Review Team OpenGenus Tech Review Team
Software Engineering

while loop in Java

A while loop is an entry controlled control flow statement that allows code to be executed repeatedly based on a given condition. In Java, while loop is widely used. On benchmarking the performance, we see that while loop is slower than for loop but is two times faster than do while loop.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Java

Postfix (i++) vs Prefix (++i) increment in Java

i++ is known as postfix increment operation while ++i is known as prefix increment operation. We compare these two operations based on Use/ Program flow, Compiler instruction and Benchmark. We demonstrate that ++i is significantly faster than i++ in Java.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Java

i++ vs i=i+1 in Java

Often, i++ and i=i+1 are considered to be same statements but in Java, both statements work differently internally. We will take a look at The compiler instructions used, Typecasting along with the operations and benchmarking the two operations. We see that i=i+1 is always faster than i++.

OpenGenus Tech Review Team OpenGenus Tech Review Team
Java

for loop in Java

for loop is an entry controlled loop that is widely used in Java programming language. Loops are used to repeat a particular coding task where each repetition follows a particular pattern which can be incorporated in a code. We provided several Java examples to demonstrate the concept

OpenGenus Tech Review Team OpenGenus Tech Review Team
Software Engineering

List in Java

There is a List interface in Java which is a child interface of Collection. The List interface supports access, insertion, deletion of the elements. Each element in List has its own index, starting at 0, then 1 and so on. To create List objects we have ArrayList() LinkedList() Vector() and Stack()

Wei-Cheng Li
Software Engineering

HashMap in Java

In Java, HashMap is a Map based collection class that is used for storing Key and value pairs which is denoted as HashMap. It does not maintain order of elements, allows one null key, multiple null values, is not thread safe, default size is 16, default load factor is 0.75 JDK1.7, JDK1.8

Yilin WU
java collection

Java Collections Framework: LinkedList

Reading time: 15 minutes Properties Java LinkedList Methods Implementations Java LinkedList is an implementation of the List and Deque interfaces. It is one of the frequently used List implementation class. It extends AbstractSequentialList

OpenGenus Tech Review Team OpenGenus Tech Review Team
java collection

Java Collections Framework: ArrayList

Java ArrayList is one of the most widely used Collection class. java.util.ArrayList class implements java.util.List interface. Java ArrayList also implements RandomAccess, Cloneable and Serializable interfaces. Java ArrayList class extends AbstractList class that the skeleton implementation of list

OpenGenus Tech Review Team OpenGenus Tech Review Team
java collection

Java Collections Framework: Iterable Interface

The Iterable interface (java.lang.Iterable) is the root interface of the Java collection classes. The Collection interface extends Iterable interface, so all subtypes of Collection implement the Iterable interface. This interface is to represent structures whose value can be traversed one by one.

OpenGenus Tech Review Team OpenGenus Tech Review Team
java collection

Java Collections Framework: Collection Interface

The Collection interface (java.util.Collection) is one of the root interfaces of the Java collection classes. A collection represents a group of objects known as its elements. The following 6 interfaces extends the Collection interface List, Set, SortedSet, NavigableSet, Queue, and Deque.

OpenGenus Tech Review Team OpenGenus Tech Review Team
OpenGenus IQ © 2025 All rights reserved â„¢
Contact - Email: team@opengenus.org
Primary Address: JR Shinjuku Miraina Tower, Tokyo, Shinjuku 160-0022, JP
Office #2: Commercial Complex D4, Delhi, Delhi 110017, IN
Top Posts LinkedIn Twitter
Android App
Apply for Internship