
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 7442 Articles for Java

4K+ Views
What is Evil Number? In mathematical terms, an Evil number is a number whose binary representation has exactly an even number of 1's present in it. For example, the binary representation of 3 is 0011. So the number 1's is even the number 3 is an evil number. A binary number is a number expressed in the base-2 numeral system, it is also known as the binary numeral system. It is always represented using two digits: 0 and 1. Each digit (0, 1, 2, 3, ...), character (a, A, b, c, D, ...Z), and symbol (@, #, $, ...) used ... Read More

3K+ Views
What is Bouncy Number? In mathematical terms, a Bouncy number is a positive integer whose digits are neither in increasing nor in decreasing order. For example: 101, 102, 103, 104, 105, 106, 107, 108, 109, and 120 are the bouncy numbers, which digits does not follow any specific order. The bouncy number will always be unsorted, and there are no bouncy numbers between the range of 1 to 100 because numbers less than 100 can have only two digits that will be either increasing or decreasing order. Input & Output Scenarios The following input and output scenarios will implement the mathematical ... Read More

7K+ Views
What is Pronic number? In mathematical terms, a Pronic number is a number that can be defined as the product of two consecutive integers. The Pronic number is in the form of n(n+1), where n is the integer. For example, the pronic numbers are 0, 2, 6, 12, 20, and so on. It is also known asa heteromecic number, oblong number, or rectangular number. Input & Output Scenarios Following are the scenarios that show the mathematical calculation for checking of the pronic number: Scenario 1 Suppose we have a number 12: Input: 12 Output: 4 x 3 = ... Read More

2K+ Views
In mathematical terms, three points are said to be collinear if all three points lie on a straight line. If the points do not lie on the same straight line, then they are not considered collinear points. Those three points represent coordinates on a plane: (x1, y1), (x2, y2), and (x3, y3). They must lie on the same straight line to be considered collinear. Where, x1, y1, x2, y2, x3, y3 are the points on x and y axis and (x1, y1), (x2, y2), (x3, y3) are the coordinates.Determining Colinearity Mathematically, there are two ways to know whether the three points ... Read More

9K+ Views
A Triangle is a polygon that has 3 sides, and it consists of three sides and three vertices. The sum of the three internal angles is up to 180 degrees. Below is the diagram of a triangle having three sides (a, b, and c): In a valid triangle, if you add any two sides, then it will be greater than the third side. As per our problem statement, we have to check if a triangle is valid or not, if three sides are given, using the Java programming language. Suppose a, b and c are the three sides of ... Read More

997 Views
A Prism refers to a three-dimensional solid object which has two identical ends. A prism has two faces, which are: Top and Bottom face. Lateral face Both top and bottom faces are called bases which are identical to each other. All lateral faces are also identical to each other which belong to the class of parallelograms. When the base of the prism is triangular in shape that prism is called a Triangular prism. Similarly, when the base of a prism is rectangular in shape it is called a Rectangular prism. ... Read More

957 Views
There are three types of inheritance mapping strategies − Table per class hierarchy Table per concrete class Table per subclassIn this article, we will discuss table per class hierarchy. Table per class hierarchy In this, only a single table is created for inheritance mapping. Disadvantages of this approach is that a lot of null values gets stored in the table. @Inheritance(strategy=InheritanceType.SINGLE_TABLE), @DiscriminatorColumn and @DiscriminatorValue are the annotations used in this strategy. @DiscriminatorColumn is used to create an additional column which is used to identify the hierarchy classes. Consider the following example to understand this − Steps ... Read More

3K+ Views
In this article, we will see how we can execute batch insert/update in hibernate. Whenever we execute a sql statement, we do it by making a network call to the database. Now, if we have to insert 10 entries to our database table, then we have to make 10 network calls. Instead we can optimize our network calls by using batching. Batching allows us to execute a group of SQL statements in a single network call. To understand and implement this, let us define our entities − @Entity public class Parent { @Id @GeneratedValue(strategy ... Read More

2K+ Views
Most of the time when we use JPA queries, the result obtained is mapped to an object/particular data type. But When we use aggregate function in queries, handling the result sometimes require us to customize our JPA query. Let’s understand this with help of an example (Department, Employee) − Dept.java @Entity public class Dept { @Id private Long id; private String name; @OneToMany(mappedBy = "dep") private List emp; //Getters //Setters } A department can have one or more ... Read More

2K+ Views
Caching helps to reduce database network call, for executing queries. First level cache is linked with a session. It is implemented implicitly. First level cache exist only till the session object is there. Once session object is terminated/closed, there will be no cache objects. Second level cache works across multiple sessions objects. It is linked with a session factory. Second level cache objects are available to all the session in a single session factory. These cache objects are terminated when that particular session factory is closed. Implementing second level caching We need to add the following dependencies in order to ... Read More