Recent Updates: TIBCO RV FIX PROTOCOL JAVA TUTORIAL

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

This Blog Posts All Posts Directory Listings Articles

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

When to use intern() method of String in Java?

12/14/2015 08:41:00 AM

String.intern() method can be used to to deal with String duplication problem in Java. By carefully using the intern() method you can save a lot of memories consumed by duplicate String instances. A string is duplicate if it contains the same content > read more

How to split a comma separated String in Java? Regular Expression Example

12/10/2015 08:15:00 AM

You can use String.split() function or StringTokenizer class to split a comma separated String in Java. Since splitting a String is a very common functionality, Java designers have provided a couple of split() method on java.lang.String class itself. > read more

5 Good Books for Java JEE Programming Job Interviews

12/08/2015 07:54:00 AM

If you are preparing for Java interviews then apart from blogs and articles, you should also take help of books specially written for Java interviews. Though nothing can substitute true job experience but the interview is little bit different beast. > read more

Top 30 Microsoft Interview Questions for Software Development Engineers (SDE)

12/04/2015 08:15:00 AM

In this article, I am going to some frequently asked Microsoft Interview Questions for their Software Development Engineer role. I am mostly sharing technical questions which are based upon Data structure and Algorithms, and Software design. They don > read more

Why Programmers should take their CV seriously? 5 Tips to Make Better Resume

12/02/2015 09:03:00 AM

Recently I received an email from one of my readers that he is not getting enough interview calls though he was applying to every possible job he could from Job portals like Monster.com and Naukri.com. I asked him to send his resume to me and within > read more

2nd highest salary in Oracle using ROW_NUMBER and RANK in Oracle and MSSQL

11/30/2015 06:31:00 AM

This is the second article about calculating 2nd highest salary in SQL. In the first part, you have learned how to find the second highest salary in MySQL, SQL SERVER and by using ANSI SQL, which should also work in all database which confirms ANSI s > read more

How to find PID of process listening on a port in Linux? netstat and lsof command examples

11/07/2015 09:08:00 AM

In Linux, many times, you want to find out the PID of a process which are listening on a port e.g. if multiple tomcat servers are running on a host then, how do you find the PID of the tomcat listening on port 8080? There are many UNIX commands to fi > read more

Top 20 Core Java Interview Questions and Answers from Investment Banks

11/05/2015 10:09:00 AM

Core Java Interview Question Answer This is a new series of sharing core Java interview question and answer on Finance domain and mostly on big Investment bank.Many of these Java interview questions are asked on JP Morgan, Morgan Stanley, Barclays or > read more

5 Free OCAJP8, OCPJP8 Mock Exams and Practice questions - 1Z0-808 809 (Java 8 Certification)

11/04/2015 06:18:00 AM

In order to do well on Java certifications, you need good books and a reasonable number of practice questions before you go for exams. Practice questions and mock exams will help you to assess your topic-wise preparation level and help you to identif > read more

How to find length of String in SQL SERVER? LEN() Function Example

11/02/2015 08:44:00 AM

You can use LEN() function to find the length of a String value in SQL Server, for example, LEN(emp_name) will give you the length of values stored in the column emp_name. Remember this is different than the length of the actual column which you spec > read more

How to send HTTP request from UNIX or Linux? Use curl or wget command

10/29/2015 10:13:00 AM

You can use either curl or wget command to send HTTP request from UNIX or Linux operating system. Both commands allow you to send GET and POST request, which means you can also call REST web services.  I have a Java web application, which runs on Li > read more

How to replace NULL with Empty String in SQL SERVER? ISNULL and COALESCE Examples

10/26/2015 09:02:00 AM

We often need to replace NULL values with empty String or blank in SQL e.g. while concatenating String. In SQL SERVER, when you concatenate a NULL String with another non-null String the result is NULL, which means you lose the information you alread > read more

Code Academy now has a FREE course to Learn Java for Beginners

10/24/2015 02:05:00 AM

Code Academy has now released their full Java course and within days almost 60K+ students has already registered. Does it say anything about the popularity of Java? Given Java provides the really good prospect of getting a job and there are more than > read more

How to implement Binary Search tree in Java? Example

10/23/2015 09:03:00 AM

A binary search tree or BST is a popular data structure which is used to keep elements in order. A binary search tree is a binary tree where the value of a left child is less than or equal to the parent node and value of the right child is greater th > read more

133 Java Interview Questions Answers From Last 5 Years - The MEGA List

10/19/2015 09:37:00 AM

Time is changing and so is Java interviews. Gone are the days, when knowing the difference between String and StringBuffer can help you to go till the second round of interview, questions are becoming more advanced and interviewers are asking more de > read more

FIX Log Viewer - Tool to view FIX messages in Readable format

10/15/2015 11:00:00 AM

It's been a long time, I wrote anything related to FIX protocol, my last article was about FIX protocol dictionaries, also known as Fixtionnary, one of the most important tools of the trade for Java developers and support personnel working in FIX > read more

What is Double Brace Initialization in Java? Anti Pattern Example

10/12/2015 09:41:00 AM

Double brace initialization is a Java idiom to initialize a Collection like a list, set and map at the time of declaration. At times, you need a list of fixed elements e.g. supported products, supported currencies or some other config, and on the spo > read more

SQL Server JDBC Error: The TCP/IP connection to the host Failed

10/09/2015 10:28:00 AM

I had installed SQL SERVER 2014 Express edition and I was trying to connect to SQL SERVER from Java program using JDBC, but I was repeatedly getting following error:com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the host lo > read more

20 Questions You can ask to Interviewer in Programming Job Interviews?

10/07/2015 09:11:00 AM

From the first round to HR round, from telephonic to face-to-face, in almost all kind of programming interviews, there will be a time when Interviewer will give you chance to ask questions. Many programmers are too concern about asking questions, and > read more

Share Your Interview Experience with Javarevisited

10/05/2015 08:13:00 AM

Hello Guys,How are you? Hope you are doing well.It's been 5 years since I have started Javarevisited. In last five years, I have worked hard to make Javarevisited a good resource to prepare for Java interviews, and to make it even more useful, I > read more

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

10/02/2015 10:16:00 AM

You often need to convert java.util.Date to java.sql.Date if you are storing dates in database e.g. SQL SERVER or MySQL. Since JDBC has their own data types for date and time e.g. java.sql.Date, java.sql.Time and java.sql.TimeStamp to match with data > read more

How to reset ArrayList in Java - Clear vs RemoveAll

09/29/2015 10:02:00 AM

Many times we want to reset an ArrayList for the reusing purpose, by resetting we mean clearing it or removing all elements. There are two ways to reset an ArrayList in Java, by using clear() method or calling removeAll(). If your ArrayList is small > read more

Java 8 forEach() Loop Example

09/25/2015 10:18:00 AM

Java 8 has introduced a new way to loop over a Collection, by using the forEach() method of the new Stream class. You can iterate over any Collection e.g. List, Set or Map by converting them into a java.util.sttream.Stream instance and then calling f > read more

How to read File into String in Java 7, 8 with Example

09/22/2015 10:35:00 AM

Many times you want to read contents of a file into String, but, unfortunately, it was not a trivial job in Java, at least not until JDK 1.7. In Java 8, you can read a file into String in just one line of code. Prior to the release of new File IO API > read more

Eclipse - java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet in Tomcat

09/18/2015 22:54:00 PM

Problem : You are getting java.lang.ClassNotFoundException exception complaining that Spring's DispatcherServlet class is not available in class path. This error is coming while running a Spring MVC based Java application from Eclipse and Tomcat > read more

Difference between Primitive and Reference variable in Java

09/16/2015 08:31:00 AM

There are two types of variables in Java, primitive and reference type. All the basic types e.g. int, boolean, char, short, float, long and double are known as primitive types. JVM treats them differently than reference types, which is used to point > read more

How to convert float to long or int in Java?

09/11/2015 02:05:00 AM

Yesterday one of the junior from my team came to me asking about how do you I convert a float variable into long or int? He was storing some values coming from other system in database and only wanted to store value before the decimal point e.g. he w > read more

What is @SuppressWarnings annotation in Java? Unchecked, RawTypes, Serial

09/08/2015 10:07:00 AM

@SuppressWarnings annotation is one of the three built-in annotations available in JDK and added along side @Override and @Deprecated in Java 1.5. @SuppressWarnings instruct compiler to ignore or suppress, specified compiler warning in annotated elem > read more

How to loop over two dimensional array in Java?

09/04/2015 08:48:00 AM

You can loop over two dimensional array in Java by using two for loops, also known as nested loop. Similarly to loop an n-dimensional array you need n loops nested into each other. Though its not common to see array of more than 3 dimension and 2D ar > read more

Difference between Java and C++ Constructor - Interview Question

09/02/2015 09:40:00 AM

If you are a C++ Programmer, now learning Java then you will find lot of similarity between two of the most popular object oriented programming languages e.g. both support Abstraction, Encapsulation, Class, Object and other OOP concepts. But, they ar > read more

Difference between SOAP and RESTful Web Service in Java

08/31/2015 09:03:00 AM

Though both SOAP and RESTful web services allows a client to query server for some information, but the way they are implemented and used is quite different. Main difference between SOAP and REST is that former provides an standard of communication b > read more

Eclipse - 2 ways to solve Unsupported major.minor version 51.0 error in Java

08/29/2015 02:47:00 AM

Unsupported major.minor version 51.0 error comes when you run a class file created using Java 1.7 (major version 51.0) into a lower JRE version e.g. JRE 6, 5 or 4. There are two ways to solve this problem, first make sure you run your Java program in > read more

How to calculate Large Factorials using BigInteger in Java?

08/26/2015 09:41:00 AM

Factorial of numbers greater than or equal to 13 cannot be found using primitive int data type as shown in our earlier factorial solution due to overflow. These factorials are too large to fit in an int variable, whose maximum value is just 21474836 > read more

Difference between HashMap, LinkedHashMap and TreeMap in Java

08/24/2015 08:19:00 AM

Map is one of the most important data structure from Java Collection Framework.  It provides hash table data structure functionality with it's rich implementations like HashMap, Hashtable, LinkedHashMap and little bit of sorting with TreeMap. So > read more

5 Entertaining Posts from StackOverFlow - Must Read

08/20/2015 09:25:00 AM

StackOverFlow is great place to look for help, learn and participate, but it's also a great place to taste some real entertainment, contributed by programmers from all over the world. Though, due to strict policies of stackoverflow.com, most of e > read more

11 Tips to become a better Interviewer? (Programming)

08/18/2015 09:38:00 AM

For a change this article is not for candidates who are preparing for interviews, but for those programmers who are responsible for taking interviews. At some point in your career as programmer, you will have responsibility to hire developers for you > read more

How to Find All Permutations of String in Java using Recursion

08/14/2015 10:53:00 AM

How to find all permutation of a String using recursion is one of the tricky coding question from Programming job interviews. I have first seen this question in my college exam, when we were asked to code the solution using C or C++ language. Since t > read more



© 2006-2016 OnToplist.com, All Rights Reserved