Home » Tag Archives: java basics

Tag Archives: java basics

Java System.out.println() Example

Hello readers, in this tutorial we will learn the Java System.out.println() statement. 1. Introduction In Java, System.out.println() is a statement that prints the output to the console. In Java, this complete statement is divided into three parts, System is a final class in the java.lang package. This class is responsible to provide input/output streams, access to the environment variables etc ...

Read More »

Java Max Int Example

1. Introduction Int is one of the most popular primitive data types of java and we use it almost everywhere. This article explains technical specs about max int. 2. Java Max Int According to java, int data type is 32-bit signed two’s complement integer, which has a range from [ -2^31,2^31-1].  Create a new class with name MaxIntegerExample1 and copy-paste the following code : ...

Read More »

Java Extends Keyword Example

Hello readers, in this tutorial, we will learn the Java extends keyword. 1. Introduction In Java, a subclass can extend the properties of its parent class by using the extends keyword. In Java, java.lang.Object is the parent class of all classes. Do note, this is implicit and does not require to be specified explicitly A class can only extend a ...

Read More »

Java 8 Functional Interfaces Introduction Example

Hello readers! In this tutorial, we will learn the amazing feature of Java 8 Functional Interfaces. 1. Introduction To achieve the benefits of functional programming in Java, JDK developers introduced Functional Interfaces/Single Abstract Method (SAM) Interfaces in Java 8 programming. A functional interface is an interface that has only one abstract method A functional interface can have multiple default and ...

Read More »

Math.pow Java Example

In this article, we examine the Math.pow Java method and we provide some examples of its use. 1. Introduction The java.lang package provides classes and interfaces that are central to the Java programming language. The Math class from the java.lang package contains static methods for performing many common math operations. These include exponential, logarithm, square root, and trigonometric functions. One ...

Read More »

Java Singleton Design Pattern – Best Practices with Examples

In this post, we feature a comprehensive Tutorial on Java Singleton Design Pattern. Design Patterns in Java are incredibly popular among the software developers. One of the most common interview questions is the Singleton Design Pattern. So in this tutorial, I’ll summarize the best practices which will help developers dodge general issues and develop better applications. Table Of Contents 1. ...

Read More »

Java Servlet Hidden Field Example

A hidden form field is a technique used to store the session information for a particular client and is one of an important Session Tracking Technique. In this tutorial, we will explain and show you how to handle the hidden fields in a Servlet. 1. Introduction Session Tracking is a technique to maintain the requests of the same user for a ...

Read More »

Java Servlet onclick Example

Servlets are modules of the Java code that run in a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP. The word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain and show you how to call a Servlet ...

Read More »

Java Servlet Life Cycle Example

Servlets are modules of the Java code that run on a server application to answer the client requests. They are not tied to a specific client-server protocol but are most commonly used with HTTP and the word “Servlet” is often used in the meaning of “HTTP Servlet“. In this tutorial, we will explain the Servlet Lifecycle. 1. Introduction Servlet is ...

Read More »

Hibernate SQL Parameter Values using Log4j Example

When using Hibernate, if developers log the Hibernate SQL statements, they will see something like this: Hibernate: insert into student (id, first_name, last_name, email) values (?, ?, ?, ?) However, for debugging the application, developers want to see the actual parameter values in the Hibernate logs i.e. basically, they want to get rid of the question marks in the logs. ...

Read More »