Examples of Sets in Java

This article demonstrates some Examples of Sets in Java. The Set Interface in Java Basically, it is an unordered collection and doesn’t allow duplicates. When you add a duplicate element, it will replace the existing one. TreeSet class implements the Set interface. It represents a sorted collection. When we need to store the user defined objects in TreeSet, then we […]

ArrayList Exercise in Java

The following ArrayList Exercise in Java will help you to work with the ArrayList collection class. Create an ArrayList in Java and add the days of the week. Also, display the ArrayList. Define a class Emp with the following fields – emp_id, name, salary, gender, department, and email_id. Also, define the corresponding constructors, and getter and setter methods. Further, override […]

Logic Building Exercise in Java

The following Logic Building Exercise in Java will help you crack a coding round in a programming job selection process. Find whether a number is a palindrome or it can become a palindrome by adjusting a single digit. Write a program to find the cyclic sum of the digits of a number. How to find the sum of array elements […]

Spring Boot Practice Questions and Their Solutions

The following list provides some Spring Boot Practice Questions and Their Solutions. Application Based Spring Boot Practice Questions and Their Solutions Develop a simple Spring Boot application that displays ‘Welcome to programmingempire.com’. Demonstrate the use of Dependency Injection and auto-wired with Spring Boot. For this purpose, create an application involving the three classes – RegularFaculty, Visitingfaculty, and AdhocFaculty. Also, create […]

Spring Boot Explained in Simple Way

In this article on Spring Boot Explained in Simple Way, I will explain the concept of Spring Boot. Basically, Spring Boot greatly simplifies the way in which we develop Spring applications. In fact, the Spring Boot is one of the modules of the Spring Framework. Hence, it resides on the top of the Spring Framework. Furthermore, the Spring Boot is […]

Spring Framework Practice Problems and Their Solutions

This article presents a few Spring Framework Practice Problems and Their Solutions. A Brief Tutorial on Spring Framework A Java application has a Model class ‘Art’. Further, this class has three attributes – art_id, art_title, and artist_name. You are required to create a Spring XML configuration file to create a bean entry for the Art object. This object must have […]

Hibernate Practical Problems and Their Solutions

In this article, I will present some of the Hibernate Practical Problems and Their Solutions that will help you work with Hibernate. Basically, Hibernate is a Java Framework for ORM (Object Relational Modeling). In other words, Hibernate provides a mapping of Java classes to the database tables. The following list provides Hibernate Practical Problems and Their Solutions to get a […]

Using JavaBeans in a JSP

This article explains Using JavaBeans in a JSP. Further, a few examples of using JavaBeans in a Java Server Page (JSP) are also provided. Basically, a JavaBean is nothing but a Java class that follows certain conventions. It represents a reusable software component. A JavaBean must define a public default constructor. Also, all of its properties must be private. These […]

Servlet and JSP Practice Questions

The following list provides some of the Servlet and JSP Practice Questions and their solutions. Write a program that displays “Servlet Tutorial – programmingempire.com”. Create a servlet that displays the request headers and their values. Further, create an HTML form that contains text fields, text area, radio buttons, drop-down list, checkboxes, and date. Also, create two different servlets to display […]

Exercise on Object Oriented Programming in Java

This article presents an Exercise on Object Oriented Programming in Java. The following Exercise on Object Oriented Programming in Java will help you understand the concepts of classes, objects, encapsulation, static methods, polymorphism, method overriding, and inheritance. Also, the solution for each program is provided here. Create a class named Box with three attributes – width, height, and depth. Also, […]