Recent Updates: TIBCO RV FIX PROTOCOL JAVA TUTORIAL

Visit http://javarevisited.blogspot.com/ For Recent Updates.

This Blog Posts All Posts Directory Listings Articles

How to read a text file using Scanner in Java? Example Tutorial

07/24/2016 03:02:00 AM

As I told you before that there are multiple ways to read a file in Java e.g. FileReader, BufferedReader, and FileInputStream. You chose the Reader or InputStream depending upon whether you are reading text data or binary data, for example, the Buffe > read more

Difference between row_number(), rank() and dense_rank() in SQL Server, Oracle.

07/23/2016 09:32:00 AM

Though all three are ranking functions in SQL, also known as window function in Microsoft SQL Server, the difference between rank(), dense_rank(), and row_number() comes when you have ties on ranking i.e. duplicate records. For example, if you are ra > read more

How to calculate GCF and LCM of two numbers in Java? Example

07/18/2016 23:27:00 PM

This week's programming exercise is to write a Java program to calculate GCF and LCM of two numbers. The GCF, stands for Greatest common factor and LCM stands for Lowest common multiplier, both are popular mathematical operation and related to ea > read more

Difference in String pool between Java 6 and 7

07/15/2016 03:32:00 AM

String pool in Java is a pool of String literals and interned Strings in JVM for efficient use of String object. Since String is immutable in Java, it makes sense to cache and shares them in JVM. The String pool has gone through an important change i > read more

Binary Tree PreOrder Traversal in Java - Recursion and Iteration Example

07/11/2016 08:48:00 AM

Unlike linked list and array which can only be traversed linearly, there are several ways to traverse a binary tree. The tree traversal algorithms are mainly divided into two parts, depth first and breadth first. As their name suggests, in depth firs > read more

Eclipse - How to add/remove external JAR into Java Project's Classpath

07/09/2016 08:43:00 AM

There are multiple ways you can add an external JAR into the classpath of a Java project in Eclipse, but all goes via adding them into build path. Many beginner's struggles to add JARs into classpath and we will try to address that problem in thi > read more

How to remove duplicate rows from a table in SQL

07/07/2016 10:39:00 AM

There are a couple of ways to remove duplicate rows from a table in SQL e.g. you can use a temp tables or a window function like row_number() to generate artificial ranking and remove the duplicates. By using a temp table, you can first copy all uniq > read more

10 Examples to read a text file in Java

07/05/2016 10:08:00 AM

The Java IO API provides two kinds of interfaces for reading files, streams and readers. The streams are used to read binary data and readers to read character data. Since a text file is full of characters, you should be using a Reader implementation > read more

Printing Largest and Smallest of N numbers without using Array in Java

07/02/2016 23:31:00 PM

One of the common programming questions is, how do you find the largest and smallest number in N numbers without using arrays in Java? Can you write a program to solve this problem? Well, it's very similar to the problem we have seen before, find > read more

How to take array input in Java using Scanner - Example

07/02/2016 05:54:00 AM

There is no direct way to take array input in Java using Scanner or any other utility, but it's pretty easy to achieve the same by using standard Scanner methods and asking some questions to the user. For example, if you want to take a one-dimens > read more

Top 5 Books for Programming/Coding Interviews - Best of lot

06/29/2016 08:54:00 AM

If you are preparing for Programming Job interviews and looking for some of the best books for programming questions then you have come to the right place. In this article, I am going to share a couple of good books to prepare coding, software design > read more

How to convert java.sql.Date to java.util.Date in Java - JDBC Example

06/27/2016 09:00:00 AM

You often need to convert java.sql.Date to java.util.Date while interacting with databases from Java application. Since JDBC the Java API for database connectivity uses java.sql.Date to represent and most of the java code accepts java.util.Date, you > read more

How to close telnet terminal in Linux and Windows (quit, exit not working)

06/25/2016 23:16:00 PM

The telnet is one of the most useful networking commands, which is used to check if a server is listening on a particular port on the remote host, but it's a little bit tricky to use, especially, if you are not using it daily. Though I have used > read more

How to make Eclipse use spaces instead of tabs in Java editor

06/25/2016 01:01:00 AM

I use Eclipse IDE extensively to write Java programs for testing and example purpose, but when I copy those program in any text editors e.g. VIM, Notepad, TextPad or Edit plus, the indentation goes weird. I see a lot of white spaces which makes the p > read more

10 Examples of Joining String in Java 8 - StringJoiner and String.join()

06/22/2016 10:14:00 AM

It's quite common in day to day programming to join Strings e.g. if you have an array or List of String let's say {Sony, Apple, Google} and you want to join them by comma to produce another String "Sony, Apple, Google", there is not an easy w > read more

Why use Log4j logging vs System.out.println in Java

06/20/2016 11:00:00 AM

Printing messages to the console is an integral part of development, testing and debugging a Java program. If you are working on a Server side application, where you can not see what's going on inside the server, your only visibility tool is a lo > read more

How to install Maven on Windows 7,8 or 10?

06/19/2016 04:45:00 AM

There is no difference in installing Maven on Windows7, Windows 8, Windows 8.1 or Windows 10, you can follow the same steps to install Maven in any version Windows operating system. Installing Maven is very easy, just download the Apache Maven ZIP fi > read more

Maven Eclipse Error - "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK"

06/18/2016 00:16:00 AM

If you are like many Java developer who uses Maven and Eclipse to build Java project using M2Eclipse plugin, you might have seen this error before. I ran into it recently when I ran the Maven Install command for one of the Java projects, configured a > read more

Top 5 Books to Learn Concurrent Programming and Multithreading in Java - Best, Must Read

06/15/2016 08:55:00 AM

Books are very important to learn something new and despite being in the electronic age, where books have lost some shine to internet and blogs, I still read and recommend them to get a complete and authoritative knowledge on any topic e.g. concurren > read more

How to add Primary key into a new or existing table in SQL Server

06/13/2016 09:49:00 AM

Since a primary key is nothing but a constraint you can use ALTER clause of SQL to add a primary key into existing table. Though it's an SQL and database best practice to always have a primary key in a table, many times you will find tables which > read more

2 Books to Prepare Java EE 6 Web Component Developer Certified Expert 1Z0-899 Exam (OCEJWCD)

06/11/2016 07:21:00 AM

Oracle launched "Java EE 6 Web Component Developer Certified Expert 1Z0-899 Exam" in 2011 to replace "Java Platform, Enterprise Edition 6 Java Server Pages and Servlet Developer Certified Expert Exam" and the "Oracle Certified Expert, Java Platform, > read more

How to Remove Duplicate Characters from String in Java

06/09/2016 09:59:00 AM

This week's coding exercise is to remove duplicate characters from String in Java. For example, if given String is "aaaaaa" then output should be "a", because rest of  the "a" are duplicates. Similarly, if the input is "abcd" then output should > read more

Java Object Oriented Analysis and Design Problem - Vending Machine Part 2

06/07/2016 09:28:00 AM

This is the second part of Java tutorial to show how to create Vending Machine in Java. In the first part, we have discussed problem statement and the solution itself, but unit testing and design document was still pending, which we'll see in thi > read more

Design a Vending Machine in Java - Interview Question

06/04/2016 22:06:00 PM

How do you design a Vending Machine in Java? is one of the good Java interview questions mostly asked at Senior level Java developer Interviews. In a typical coding interview, you will be given a problem statement to develop a vending machine and wit > read more

10 Example of lsof commands in UNIX and Linux

06/02/2016 08:05:00 AM

It's been a long time I have written anything on UNIX or Linux, but today I'll talk about the lsof command, a utility command every system admin and developer love. The lsof command stands for list open file descriptors and as the name sugge > read more

What are Idempotent and Safe methods of HTTP and REST

05/31/2016 09:23:00 AM

In order to efficiently work with REST and RESTful web service, good knowledge of HTTP is really helpful. Even though REST seems easy, designing a uniform and consistent RESTful API is a tough job. One of the tricky tasks is choosing right the HTTP m > read more

Minecraft - java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied Solution

05/29/2016 04:07:00 AM

You can resolve java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied error in Minecraft by disabling your anti-virus and run. Later you can whitelist the lwjgl64.dll, so that your anti-virus will not block it again. I have talked about java.la > read more

How to reverse an ArrayList in place in Java - Example

05/28/2016 04:00:00 AM

You can reverse an ArrayList in place in Java by using the same algorithm we have used to reverse an array in place in Java. If you have already solved that problem then It's a no-brainer because ArrayList is nothing but a dynamic array, which ca > read more

Best practices to name your JAR file in Java

05/26/2016 08:31:00 AM

If you are an author of an internal, proprietary Java library or an external open source library,  or you are one of those lucky developers who ship Java application by yourself then you should follow these best practices while naming your JAR files > read more

5 Free Data Structure and Algorithm Books in Java Programming

05/23/2016 10:06:00 AM

In last article, I have shared 5 good data structure and algorithms books, but those were not free. After that article, I received some feedback about how about free data structure and algorithm books? Fair enough, everybody loves free eBooks, don > read more

How do you find length of a Singly Linked list using Loop and Recursion

05/21/2016 23:30:00 PM

Hi Guys,Here is one of the classical programming questions asked to me first time on an interview with multinational Investment bank. After that, this question has been asked to me on several occasions in other programming job interviews as well. Wha > read more

Java Mistake 3 - Using "==" instead of equals() to compare Objects in Java

05/21/2016 08:30:00 AM

In this part of Java programming mistakes, we will take a look at another common pattern, where programmers tend to use "==" operator to compare Objects, similar to comparing primitives. Since equality of object can be very different in the physical > read more

What is difference between Synchronized and Concurrent Collections in Java?

05/21/2016 02:30:00 AM

Synchronized vs Concurrent CollectionsThough both Synchronized and Concurrent Collection classes provide thread-safety, the differences between them comes  in performance, scalability and how they achieve thread-safety. Synchronized collections like > read more

How do you find length of a Singly Linked list using Loop and Recursion

05/21/2016 02:00:00 AM

Hi Guys,Here is one of the classical programming questions asked to me first time on an interview with multinational Investment bank. After that, this question has been asked to me on several occasions in other programming job interviews as well. Wha > read more

Command design Pattern in Java with Example

05/19/2016 08:38:00 AM

In simple words, Command design pattern is used to separate a request for an action from the object which actually performs the action. This decoupling between Invoker and Receiver object provides a uniform ways to perform different types of actions. > read more

Difference between float and double variable in Java?

05/16/2016 10:22:00 AM

Though both float and double datatype are used to represent floating point numbers in Java, a double data type is more precise than float. A double variable can provide precision up to 15 to 16 decimal points as compared to float precision of 6 to 7 > read more

Difference between close and deallocate cursor in SQL

05/12/2016 08:36:00 AM

Cursor in a database is used to retrieve data from the result set, mostly one row at a time. You can use Cursor to update records and perform an operation on a row by row. Given its importance on SQL and Stored procedure, Cursor is also very popular > read more

Top 10 Google Interview Questions for Software Engineer - Books, Resources

04/23/2016 07:30:00 AM

These Google interview questions are some of my favorites collected from different sources. Every Programmer knows that Google is one of the best technology company and its dream for many software developers to work for google, but at same time inter > read more

Difference between notify and notifyAll in Java - When and How to use

04/22/2016 13:30:00 PM

notify vs notifyAll in Java What is the difference between notify and notifyAll method is one of the tricky Java questions, which is easy to answer but once Interviewer asks follow-up questions, you either got confused or not able to provide clear-cu > read more

Difference between ExecutorService.submit() and Executor.execute() methods in Java?

04/19/2016 09:53:00 AM

What is the difference between Executor.submit() and Executor.execute() method in Java? is one of the good multi-threading questions for experienced Java programmers, mostly asked in Investment Banks like Barclays, Deutsche Bank, or Citibank. A main > read more

Difference between Oracle SQL Query vs Microsoft SQL Server 2008 or Sybase

04/10/2016 08:35:00 AM

Oracle and Microsoft SQL Server are two of the most popular database but they are very different with each other and if you are migrating SQL queries or database, tables from Oracle 11g database to Microsoft SQL Server 2008 then you are bound to face > read more

What is purpose of different HTTP Request Types in RESTful Web Service?

04/10/2016 03:49:00 AM

RESTful web services heavily rely on HTTP by design. They use different HTTP methods to perform their job and uses HTTP response code to inform clients about success or failure of a particular request. REST stands for Representational State transfer > read more

3 Ways to Solve jQuery - Uncaught ReferenceError: $ is not defined Error

04/09/2016 02:59:00 AM

If you are using jQuery, Angualr JS or plain old JavaScript and getting "Uncaught ReferenceError: $ is not defined" error which means $ is either a variable or a method which you are trying to use before declaring it using var keyword. In jQuery, it& > read more

How to Convert Result of SELECT Command to Comma Separated String in SQL Server

04/03/2016 04:38:00 AM

Sometimes, you need the result of SQL SELECT clause as a comma separated String e.g. if you are outputting ids of white-listed products. By default, the SELECT command will print each row in one line and you get a column of names or ids. If you need > read more

10 Examples of Converting a List to Map in Java 8

04/02/2016 08:19:00 AM

Suppose you have a List of objects, List and you want to convert that to a Map, where a key is obtained from the object and value is the object itself, how do you do it by using Java 8 stream and lambda expression? Prior to Java 8, you can do this by > read more

How to increase length of existing VARCHAR column in SQL Server

03/27/2016 04:12:00 AM

You can increase the length of a VARCHAR column without losing existing data in SQL Server. All you need to do is that execute following ALTER TABLE statements. Though, you need to specify NULL or NOT NULL constraint explicitly, depending upon your d > read more

How to find the first element of Stream in Java 8 - findFirst() Example

03/26/2016 04:31:00 AM

In Java 8, you can use the Stream.findFirst() method to get the first element of Stream in Java. This is a terminal operation and often used after applying several intermediate operations e.g. filter, mapping, flattening etc. For example, if you have > read more

Java 1.5 Generics Tutorial: How Generics in Java works with Example of Collections, Best practices, Gotchas

03/25/2016 08:30:00 AM

Java Generics TutorialGenerics in Java is one of important feature added in Java 5 along with Enum, autoboxing and varargs, to provide compile time type-safety. Generics is also considered to be one of the tough concepts to understand in Java and som > read more

Difference between Wait and Sleep, Yield in Java

03/25/2016 00:00:00 AM

The difference between wait and sleep or the difference between sleep and yield in Java are one of the popular core Java interview questions and asked on multi-threading interviews. Out of three methods which can be used to pause a thread in Java, sl > read more

Top 10 Servlet Interview Question Answers - J2EE

03/24/2016 22:30:00 PM

This time its servlet interview questions, I was thinking what to pick for my interview series and then I thought about J2EE and Servlet is my favorite on that space. Servlet is an important part of any J2EE development and serves as Controller on ma > read more

Difference between Stack and Heap memory in Java

03/24/2016 08:01:00 AM

The difference between stack and heap memory is common programming question asked by beginners learning Java or any other programming language. Stack and heap memory are two terms programmers starts hearing once they started programming but without a > read more

How Garbage Collection works in Java

03/23/2016 09:30:00 AM

I have read many articles on Garbage Collection in Java, some of them are too complex to understand and some of them don’t contain enough information required to understand garbage collection in Java. Then I decided to write my own experience as an > read more

Top 10 basic networking commands in linux/unix

03/22/2016 10:30:00 AM

Networking is an essential part Unix and it offer lots of tools and command to diagnose any networking problem. When I was working on FIX Protocol we get a lot of support queries to see whether FIX Sessions are connected or not. Since FIX Protocol us > read more

How to delete from table using JOIN in SQL Server

03/19/2016 23:59:00 PM

It's a little bit tricky to delete from a table while using any type of JOIN in SQL e.g. Inner Join, Left Outer Join, or Right Outer Join. The obvious syntax doesn't work as shown below:delete from #Expired e INNER JOIN Deals d ON e.DealId = > read more

How to Reverse an ArrayList in Java using Recursion - Example Tutorial

03/18/2016 22:41:00 PM

If you ever need to reverse a List in Java e.g. ArrayList or LinkedList, you should always use the Collections.reverse() method. It's safe and tested and probably perform better than the first version of the method you write to reverse an ArrayLi > read more

Java Synchronization Tutorial : What, How and Why?

03/17/2016 09:00:00 AM

Multithreading and synchronization are a very important topic for any Java programmer. Good knowledge of multithreading, synchronization, and thread-safety can put you in front of other developers, at the same time, it's not easy to master this c > read more

How to Convert an Array to Comma Separated String in Java

03/16/2016 09:16:00 AM

The simplest way to convert an array to comma separated String is to create a StringBuilder, iterate through the array, and add each element of the array into StringBuilder after appending comma. You just need Java 1.5 for that, even if you are not r > read more

10 Hibernate Interview Questions and Answers for Java J2EE Programmers

03/13/2016 01:00:00 AM

Hibernate Interview Questions are asked on Java J2EE Interviews, mostly for web based enterprise application development role. Success and acceptability of Hibernate framework on Java world have made it one of the most popular Object Relational Mappi > read more

How to Reverse a String in place in Java - Example

03/12/2016 05:38:00 AM

It's possible to reverse a String in place by using a StringBuilder. Since String is Immutable in Java, it's not possible to reverse the same String, but you can minimize the number of intermediate String objects by using StringBuilder or Str > read more

How to Remove First and Last Character of String in Java - Example Tutorial

03/11/2016 08:50:00 AM

You can use the substring() method of java.lang.String class to remove the first or last character of String in Java. The substring() method is overloaded and provides a couple of versions which allows you to remove a character from any position in J > read more

How to convert an Array to HashSet in Java - Example Tutorial

03/06/2016 04:04:00 AM

The array was there in Java before the Collection framework makes its entry in JDK 1.4, hence, you will find several legacy code, which accepts array than the Collection or Set. Due to this, we often need to convert an array to different types of col > read more

3 Books to Learn Eclipse IDE for Java JEE Programmers - Best of Lot

03/05/2016 21:06:00 PM

In order to become a good Java developer solid knowledge of Eclipse IDE, or whatever IDE you use e.g. Netbeans or IntelliJ Idea, is a must. Java has been blessed with excellent tooling which turbo-charge application development. IDEs or Integrated De > read more

Difference between map() and flatMap() in Java 8 Stream

03/03/2016 09:36:00 AM

The map() and flatmap() are two important operations in new functional Java 8. Both represents functional operation and they are also methods in java.util.stream.Stream class. The key difference between map() and flatmap() function is that when you u > read more

How to Copy Non Empty Directory with Files in Java 7 - Example Tutorial

02/27/2016 22:12:00 PM

It's easy to copy a file or empty directory in Java as you can use Files.copy(fromPath, toPath) from Java 7, but, unfortunately, it's not as easy to copy a non-empty directory with all its files and subdirectories in Java, much like deleting > read more

How to connect to Microsoft SQL Server database using Eclipse

02/27/2016 01:03:00 AM

Though I prefer SQL Server Management Studio to access and work with Microsoft SQL Server database, Sometimes, it's better to connect MSSQL database directly from Eclipse. This will save a lot of time which is wasted on switching between two appl > read more

Data Access Object (DAO) design pattern in Java - Tutorial Example

02/25/2016 09:00:00 AM

Data Access Object or DAO design pattern is a popular design pattern to implement persistence layer of Java application. DAO pattern is based on abstraction and encapsulation design principles and shields rest of application from any change in the pe > read more

3 Examples to Get the Id of an Element in jQuery

02/22/2016 08:51:00 AM

As a page author, the id of an HTML element is something you should know, but there are scenarios when the page is automatically generated or may be some form elements are generated by using frameworks like JSF. In that case, what do you do if you wa > read more

2 ways to Split String with Dot (.) in Java using Regular Expression

02/20/2016 21:58:00 PM

You can use the split() method of java.lang.String class to split a String based on the dot. Unlike comma, colon, or whitespace, a dot is not a common delimiter to join String, and that's why beginner often struggles to split a String by dot. One > read more

How to add Columns to an Existing table in SQL Server

02/19/2016 22:46:00 PM

Adding a new column to an existing table with data is always tricky. You need to know what data is there, how much data is there, to gauge how long your query is gonna take to complete in production. Also, you cannot add NOT NULL columns into an exis > read more

How does Enhanced for loop works in Java?

02/17/2016 09:57:00 AM

It's a long time since JDK 1.5 introduced the enhanced for loop, almost 12 years ago in the year 2004, but still many Java developers don't know basics of enhanced for loop, also known as for each loop in Java. The enhanced for loop provides > read more

Solving java.lang.ArrayindexOutOfBoundsException: 1 in Java

02/14/2016 02:51:00 AM

The error java.lang.ArrayIndexOutOfBoundsException: 1 means index 1 is invalid and it's out of bound i.e. more than the length of the array. Since array has a zero-based index in Java, this means you are trying to access the second element of an > read more

How to Loop Through An Array in Java with Example

02/13/2016 07:48:00 AM

There are multiple ways to loop over an array in Java e.g. you can use a for loop, an enhanced for loop, a while loop or a do-while loop. Since while and do-while needs a condition to terminate they often depend upon the content of the array e.g. sto > read more

6 example to declare two dimensional array in Java

02/10/2016 07:23:00 AM

Declaring a two-dimensional array is interesting in Java as Java programming language provides many ways to declare a 2D array and each way have some special things to learn about. For example, It's possible to create a two-dimensional array in J > read more

How to remove all special characters from String in Java

02/09/2016 07:34:00 AM

You can use regular expression and replaceAll() method of java.lang.String class to remove all special characters from String. A special character is nothing but characters like ! #, % etc. Precisely, you need to define what is a special character fo > read more

Introduction of How Android Works for Java Programmers

02/09/2016 06:30:00 AM

Android development is a current buzz in Java programming world. It's the Android, which keeps Java in the forefront of the last couple of years. Now, How important is to understand or learn Android for Java programmers? Well, it depends on, if y > read more

java.lang.ClassNotFoundException: com.sun.jersey.spi.container.servlet.ServletContainer [Solution]

02/07/2016 02:47:00 AM

The error message clearly says that Java runtime is not able to find a class called ServletContainer for Jersey library. This is the Servlet class you have specified in the deployment descriptor of your application. It's similar to DispatcherSe > read more

How to get first and last character of String in Java - Example

02/04/2016 08:48:00 AM

You can get the first and last character of a String using charAt() method in Java. This method accepts an integer index and returns the corresponding character from String. Since Java String is backed by an array, their index is also zero-based, whi > read more

10 Example of find command in Unix and Linux

01/23/2016 09:30:00 AM

The find command is one of the versatile commands in UNIX and Linux  and I used it a lot in my day to day work. I believe having good knowledge of find command in UNIX and understanding of its different options and usage will increase your product > read more

9 difference between Array vs ArrayList in Java

01/22/2016 09:01:00 AM

Both array and ArrayList are two important data structure in Java and frequently used in Java programs. Even though ArrayList is internally backed by an array, knowing the difference between an array and an ArrayList in Java is critical for becoming > read more

How to declare and initialize a List (ArrayList and LinkedList) with values in Java

01/20/2016 13:30:00 PM

Initializing a list while declaring is very convenient for quick use, but unfortunately, Java doesn't provide any programming constructs e.g. collection literals, but there is a trick which allows you to declare and initialize a List at the same > read more

3 ways to loop over Set or HashSet in Java? Examples

01/19/2016 08:52:00 AM

Since Set interface or HashSet class doesn't provide a get() method to retrieve elements, the only way to take out elements from a Set is to iterate over it by using Iterator, or loop over Set using advanced for loop of Java 5. You can get the it > read more

10 examples of grep command in UNIX and Linux

01/18/2016 01:00:00 AM

grep command is one of the most frequently used UNIX command stands for "Global Regular Expression Print" like find, chmod or tar command in Unix. grep command in Unix operating system e.g. Linux, Solaris, BSD, Ubuntu or IBM AIX is used to search fil > read more

5 books to learn Spring framework and Spring MVC for Java Programmers

01/17/2016 07:24:00 AM

Spring and Spring MVC is one of the most popular Java frameworks and most of new Java projects uses Spring these days. Java programmer often asks questions like which books is good to learn Spring MVC or What is the best book to learn Spring framewor > read more

Solving java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet in Java Spring MVC Application

01/16/2016 04:00:00 AM

The  java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet error comes when you deploy a Spring MVC application into Tomcat or Jetty and Servlet container not able to found this class, which usually found in the spring > read more

Why JPA Entity or Hibernate Persistence Class Should Not be Final?

01/14/2016 08:27:00 AM

One of the interesting hibernate interview questions is, why you should not make a Hibernate persistent class final? I'll try to answer this question in this short blog post. Use of proxies is the core feature of Hibernate (one of the most popul > read more

4 Ways to find Nth highest salary in SQL - Oracle, MSSQL and MySQL

01/12/2016 08:33:00 AM

One of the most common SQL interview questions is to find the Nth highest salary of employee, where N could be 2, 3, 4 or anything e.g. find the second highest salary in SQL. Sometimes this question is also twisted as to find the nth minimum salary i > read more

Top 20 Amazon and Google Programming Interview Questions

01/11/2016 07:36:00 AM

Hello, In this article I am going to sharing some frequently asked programming job interviews from technical giants and startups. If you are going for a programming job interview with Microsoft, Google or Amazon, you better be prepared for  all kind > read more

How to fix java.net.SocketException: Software caused connection abort: recv failed

01/09/2016 19:11:00 PM

Out of many client servers related socket errors here is one more interesting socket related error from Java program, "java.net.SocketException: Software caused connection abort: recv failed". The key point in this error message is "abort" and "recv > read more

Reading/Writing to/from Files using FileChannel and ByteBuffer in Java

01/08/2016 19:40:00 PM

In the past, I have talked about RandomAccessFile and how it can be used for doing faster IO in Java, and  in this Java NIO tutorial, we are going to see how to use read/write data from using FileChannel and ByteBuffer. Channel provides an alternate > read more

How does Java HashMap or LinkedHahsMap handles collisions?

01/07/2016 09:51:00 AM

Prior to Java 8, HashMap and all other hash table based Map implementation classes in Java handle collision by chaining, i.e. they use linked list to store map entries which ended in the same bucket due to collision. If a key end up in same bucket lo > read more

10 Examples of using ArrayList in Java - Tutorial

01/06/2016 06:07:00 AM

ArrayList in Java is most frequently used collection class after HashMap in Java. Java ArrayList represents an automatic re-sizeable array and used in place of array. Since we can not modify size of an array after creating it, we prefer to use Array > read more

How to check if String is not null and empty in Java?

01/05/2016 08:24:00 AM

In Java, since null and empty are two different concept, it's a little bit tricky for beginners to check if a String is both not null and not empty. A String reference variable points to null if it has not been initialized and an empty String is > read more

5 Resolutions for Java Programmers - 2016

01/04/2016 07:11:00 AM

First of all wish you very happy new year guys. It's that time of year when we start afresh, make plans, set goals and make resolutions for the new year. Being a Java developer and author of a Java blog, I frequently receive a request from Java p > read more

SQL EXISTS Example - Customers Who Never Order LeetCode Solution

01/03/2016 01:43:00 AM

Good morning Guys, Today we will learn how to use the EXISTS clause in SQL by picking up a nice SQL exercise from LeetCode. Suppose that a website contains two tables, the Customers table and the Orders table. Write an SQL query to find all customers > read more

java.net.SocketException: Failed to read from SocketChannel: Connection reset by peer

01/02/2016 00:17:00 AM

You might have seen the java.net.SocketException: Failed to read from SocketChannel: Connection reset by peer error while working with Java NIO based server which is using SocketChannel instead of InputStream for reading data from the network. In g > read more

3 Gifts for your Java Programmer Friends, Collegues or Relatives

01/01/2016 01:21:00 AM

Happy New year 2016 and Seasons greetings to everyone. May god bless you with success and whatever you want this year. This is festival time and I have a couple of friends asking me what to gift to a programmer friend or colleague? This is a common c > read more

The real difference between Process and Thread in Java

12/28/2015 09:00:00 AM

One of the common question from programming interviews is, what is the difference between a Thread and a Process? Well, the main difference between them  is that a Process is a program which is executing some code and a thread is an independent path > read more

VirtualBox - /sbin/mount.vboxsf: mounting failed with the error: Protocol error [Solution]

12/25/2015 01:02:00 AM

I use Oracle's virtual machine, Virtualbox to run the Linux operating system from my Windows machine. It's the most simple way to have two operating system in your laptop or PC. Since I run most of Java program in Linux, VirtualBox gives me a > read more

10 points about instanceof operator in Java with example

12/22/2015 09:06:00 AM

The instanceof operator in Java is used to check if an object belongs to a particular type or not at runtime. It's also a built-in keyword in Java programming language and mostly used to avoid ClassCastException in Java. It is used as safety-chec > read more

20 Java and Programming Quotes to Motivate Yourself

12/16/2015 09:52:00 AM

I always have a strong interest in knowing great peoples of my field i.e. programming. Knowing about them, following them and reading them not only gives you immense knowledge but the motivation you need to excel in what you are doing. It's motiv > read more



© 2006-2016 OnToplist.com, All Rights Reserved