Visit For Recent Updates.

This Blog Posts All Posts Directory Listings Articles

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 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, 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

Java 8 - Journey of for loop in Java, for(index) to forEach()

08/12/2015 08:18:00 AM

for loop has come a long way in Java 8 with new forEach() method in class. In this article we will take a look at journey of for loop in different versions of Java programming language. for loop is there from the very beginni > read more

Difference between Direct, Non Direct and Mapped ByteBuffer in Java

08/05/2015 09:06:00 AM

ByteBuffer is one of the important class of Java NIO API. It was introduced in java.nio package on JDK 1.4, it not only allows you to operate on on heap byte arrays but also with direct memory, which resides outside the JVM. There are mainly three ty > read more

How to revert back to Windows 8.1 from Windows 10 Update?

08/03/2015 09:12:00 AM

If you remember, I have updated to Windows 10 yesterday and blog about the problem I was facing with respect to clarity of text and blurriness on Chrome and Firefox browser e.g. text was turned white to some places and it wasn't pleasant working > read more

How to fix Chrome, Firefox Blurry, Over bright, fading after Windows 10 Update

08/01/2015 10:40:00 AM

Today morning, I updated My HP Laptop to Windows 10. First impression was great, crystal clear images, better wallpaper, better themes, better welcome screen and improved start menu and task bar at right hand corner. But when I open Chrome and Firefo > read more

Top 5 Data Structure and Algorithm Books - Must Read, Best of Lot

07/29/2015 09:01:00 AM

Data Structure and Algorithms books are often taught as text books in various universities, colleges and Computer Science degree courses, yet, when you put programmers in a situation, where they need to find and decide, which data structures and algo > read more

How to Calculate Difference between two Dates in Java (In Days)

07/27/2015 10:04:00 AM

If you are not running on Java 8, then there are two ways to calculate difference between two dates in Java in days, either by using standard JDK classes e.g. java.util.Date and java.util.Calendar or by using joda-time library. Unfortunately, Java > read more

java.sql.SQLException: No suitable driver found for jdbc:jtds:sqlserver - Cause and Solution

07/25/2015 08:49:00 AM

java.sql.SQLException: No suitable driver found for There are two ways to connect Microsoft SQL Server from Java program, either by using Microsoft's official JDBC driver (sqljdbc4.jar), or by using jTDS driver (jtds.jar). This error comes when > read more

3 Ways to Read File line by line in Java 8? Examples

07/23/2015 10:11:00 AM

Java 8 has added a new method called lines() in Files class which can be used to read a file line by line in Java. The beauty of this method is that it reads all lines from a file as Stream of String, which is populated lazily as the stream is consum > read more

How to Read XML File as String in Java? 3 Examples

07/21/2015 10:27:00 AM

Suppose you have an XML file and you just want to read and display the whole file as String in Java, may be for debugging purpose. If you are wondering how to do that in Java, well there are many ways to read XML as String in Java. You can do it in o > read more

How to convert String or char to ASCII values in Java

07/19/2015 05:48:00 AM

You can convert a character e.g. 'A' to its corresponding ASCII value 65 by just storing it into a numeric data type e.g. byte, int or long as shown below :int asciiOfA = (int) 'A';Here casting is not necessary, simply assigning chara > read more

Good time to become Java Certified Programmer - 20% discount on ALL Exams

07/17/2015 03:13:00 AM

In a nice gesture, Oracle has announced 20% discount on any Java certification to celebrate 20 years of Java. Which means, now you can get your Java SE certification at 20% discount, this is almost a saving of almost 50 USD. This is really exciting t > read more

How to find duplicate words in Java String? [Solution]

07/15/2015 10:39:00 AM

Problem :  Write a Java program to print the duplicate words from a given statement e.g. if given String is "Java and JavaScript are totally different, JavaScript follows Java" then your program should print "Java" and "JavaScript" because those two > read more

How to do GROUP BY in Java 8? Collectors.groupingBy() Example

07/13/2015 08:44:00 AM

Java 8 now directly allows you to do GROUP BY in Java by using Collectors.groupingBy() method. GROUP BY is a very useful aggregate operation from SQL. It allows you to group records on certain criteria. How do you group by in Java? For example, suppo > read more

How to solve java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver in Java 8

07/11/2015 23:21:00 PM

java.lang.classnotfoundexception sun.jdbc.odbc.jdbcodbcdriver exception comes in Java 8 because it has removed the JDBC ODBC bridge driver class "sun.jdbc.odbc.jdbcodbcdriver" from JDK and JRE. This class is required to connect any database using Obj > read more

Java ArrayList Tutorial

07/10/2015 08:36:00 AM

I have written lots of Java tutorials on ArrayList, covering many general purpose task e.g. how to create object of ArrayList and initialize to how to sort ArrayList in ascending and descending order etc. On request of my readers, I am creating this > read more

Strategy Design Pattern and Open Closed Principle in Java - Example

07/09/2015 09:00:00 AM

Strategy design pattern is based upon open closed design principle, the 'O' of famous SOLID design principles. It's one of the popular pattern in the field of object-oriented analysis and design along with Decorator, Observer and Factory > read more

5 Programming Languages Every Programmer Should Learn

07/08/2015 08:48:00 AM

I have read somewhere that programmer should learn a new programming language every year ( I think it's code complete, not sure though), but if you cannot do so, I suggest to at-least learn following five programming language to do well in your c > read more

Fibonacci series in Java without using Recursion

07/06/2015 08:26:00 AM

Fibonacci series is great example of Recursion and how use of recursion can result in clear and concise solution. That's why whenever asked about writing a Java program to get a Fibonacci numbers or print the Fibonacci series of certain numbers, > read more

java.lang.ClassNotFoundException: [Solution]

07/05/2015 05:36:00 AM

This error comes when you try to connect to Microsoft SQL Server database from Java program but the required JDBC driver is not available in Classpath or driver is available in CLASSPATH but class loader is not able to find it due classpath intricac > read more

How to Convert Fahrenheit to Celsius in Java with Example

07/03/2015 10:11:00 AM

In this Java tutorial, you will learn how to write a program to convert Fahrenheit to Celsius in Java. Fahrenheit is a thermodynamic temperature scale, where the freezing point of water is 32 degrees Fahrenheit (°F) and the boiling point of water is > read more

How to solve java.lang.UnsatisfiedLinkError: no ocijdbc11 in Java

07/02/2015 07:17:00 AM

"java.lang.unsatisfiedlinkerror no ocijdbc11 in java.library.path" error comes when you try to connect to Oracle 11g database using OCI (thick) driver by using tns name, but ocijdbc11.dll file is not available in PATH or java.library.path environme > read more

How to use wait, notify and notifyAll in Java - Producer Consumer Example

07/01/2015 09:15:00 AM

You can use wait, notify and notifyAll methods to communicate between threads in Java. For example, if you have two threads running in your program e.g.Producer and Consumer then producer thread can communicate to consumer that it can start consuming > read more

Difference between Dependency Injection and Factory Pattern in Java

06/30/2015 07:14:00 AM

TL;DR Main difference between dependency injection and factory pattern is that in case of former dependency is provided by third party (framework or container) while in case of later dependency is acquired by client class itself. Another key differen > read more

2 Ways to check If String is Palindrome in Java? Recursion and Loop

06/27/2015 22:53:00 PM

A String is said to be Palindrome if it is equal to itself in reverse order. You can use this logic to check if String is Palindrome or not. There are two common ways to find if a given String is Palindrome or not in Java, first by using for loop, al > read more

java.lang.ClassNotFoundException: org.postgresql.Driver - Cause and Solution

06/26/2015 10:01:00 AM

java.lang.ClassNotFoundException: org.postgresql.Driver error comes when you are trying to connect to a PostgreSQL database from Java program but Java ClassLoader is not able to find the Driver class "org.postgresql.Driver" required to make the conne > read more

5 Websites to Learn SQL Online for FREE

06/25/2015 09:26:00 AM

SQL is one of the most important skill for any programmer be it a Java, C++, PHP or Ruby developer. Almost 95% of the Java applications uses relational database in their back-end and almost all web applications uses database. In recent years, one of > read more

How to create HTTP Server in Java - ServerSocket Example

06/23/2015 09:20:00 AM

Java has a very good networking support, allows you to write client server application by using TCP Sockets. In this tutorial, we will learn how to create a simple HTTP Server in Java, which can listen HTTP request on a port let's say 80 and can > read more

2 Ways to Parse CSV Files in Java - BufferedReader vs Apache

06/22/2015 09:00:00 AM

In last tutorial, you have learned how to parse Excel file in Java and in this Java tutorial, you will learn how to parse CSV file in Java. You can directly parse CSV file in Java without using any third party library, because ultimately its a text f > read more

3 Ways to Find Duplicate Elements in an Array - Java

06/21/2015 10:05:00 AM

There are multiple ways to find duplicate elements in an array in Java and we will see three of them in this program. Solution and logic shown in this article is generic and applies to array of any type e.g. String array or integer array or array of > read more

Java Lock and Condition Example using Producer Consumer Solution

06/19/2015 10:29:00 AM

You can also solve producer consumer problem by using new lock interface and condition variable instead of using synchronized keyword and wait and notify methods.  Lock provides an alternate way to achieve mutual exclusion and synchronization in Jav > read more

How to use Callable and Future in Java? Example

06/17/2015 10:27:00 AM

Callable interface was added in Java 5 to complement existing Runnable interface, which is used to wrap a task and pass it to a Thread or thread pool for asynchronous execution. Callable actually represent an asynchronous computation, whose value is > read more

How to Connect to MySQL database in Java with Example

06/15/2015 09:45:00 AM

In this tutorial, You will learn how to connect to MySQL database from Java program and running SELECT and INSERT queries to retrieve and update data with step by step guide. In order to connect and access MySQL database from Java, you can use JDBC ( > read more

How to converts Java Object to XML - JAXB Example

06/12/2015 10:51:00 AM

JAXB, stands for Java API for XML Binding or sometimes Java Architecture for XML Binding is a decade old technology to directly convert a Java object into XML document (marshaling) and back to XML file into Java object(unmarshalling). It uses combina > read more

How to Read Write Excel file in Java - POI Example

06/10/2015 10:10:00 AM

In this Java Excel tutorial, you will learn how to read and write from Excel file in Java . You will learn steps to read/write both XLS and XLSX file format by using Apache POI library. In this example, we will particularly focus on reading and writi > read more

Top 30 Array Interview Questions and Answers for Programmers

06/08/2015 10:19:00 AM

Array is one of the most important topic for programming interviews. It doesn't matter if you are going to Google, Microsoft, Amazon or investment banks like Goldman Sachs, Barclays, Citi or even service based companies like IBM, Accenture, TCS, > read more

2 Websites to Learn Coding in Java Online for FREE

06/05/2015 10:05:00 AM

Here, I often receive questions like how to improve my coding skills?,  or how do I learn programming?, or I am having difficultly solving programming problems, please help etc. This is mostly from programmers, who has just started programming or a > read more

Google Protocol Buffers (ProtoBuf) - Java Serialization Alternative

06/03/2015 08:34:00 AM

If you have done some serialization works in Java, then you know that it's not that easy. Since default serialization mechanism is not efficient and has host of problems, see Effective Java Item 74 to 78, it's really not a good choice to pers > read more

Difference between Inheritance and Composition in Java OOPS

06/01/2015 08:26:00 AM

Though both Inheritance and Composition provides code reusablility, main difference between Composition and Inheritance in Java is that Composition allows reuse of code without extending it but for Inheritance you must extend the class for any reuse > read more

How to format JSON String in Java - Example Tutorial

05/29/2015 10:49:00 AM

You can format JSON String in Java using Jackson API's pretty print feature. As you might have noticed in the my previous JSON tutorials that the output of the programs is not properly formatted, which makes them hard to read, especially in large > read more

Top 10 Java Multithreading and Concurrency Best Practices

05/27/2015 09:36:00 AM

Writing concurrent code is hard and and testing correctness with concurrency is even harder. Though Java programming language provides lots of synchronization and concurrency support from language to API level, it's eventually comes to individual > read more

Sieve of Eratosthenes Algorithm to generate Prime numbers upto 100 in Java

05/25/2015 08:24:00 AM

There are many occasions when you need to generate all prime numbers upto a specified integer and one algorithm which is most often used to generate prime numbers is Sieve of Eratosthenes. Its an ancient greek algorithm to find all prime numbers upto > read more

Fixing Unsupported major.minor version 52.0 Error in Java

05/22/2015 09:45:00 AM

Unsupported major.minor version 52.0 comes when you are trying to run a class compiled using Java 1.8 compiler into a lower JRE version e.g. JRE 1.7 or JRE 1.6. Simplest way to fix this error is install the latest Java release i.e. Java 8 and run you > read more

How to differentiate between an Average and a Good Programmer?

05/19/2015 09:50:00 AM

When it comes to interview, goal is to find the most suitable developer for job to get done but its very difficult to judge someone's caliber, experience and expertise in short duration of Interview. There is always a process starting from phone > read more

How to Remove Given Character From String in Java - Recursion

04/11/2015 08:32:00 AM

Write a program to remove a given character from String in Java. Your program must remove all occurrences of given character. For example, if given String is "aaaaa" and String to remove is "a" then output should be an empty String. Similarly if inpu > read more

3 Ways to Prevent Method Overriding in Java - Private, Static and Final

04/08/2015 09:32:00 AM

Every Java programmer knows that final modifier can be used to prevent method overriding in Java because there is now way to override final methods in Java, but apart from final modifier, is there any other way to prevent a Java method to be overridd > read more

Error: Could not find or load main class HelloWorld in Java

04/06/2015 08:38:00 AM

Error: Could not find or load main class HelloWorld comes when you are trying to run your Java program using java command with main class as HelloWorld but Java is not able to find the class. In order to solve this error, you must know how Java find > read more

FizzBuzz Solution in Java 8

04/02/2015 22:49:00 PM

FizzBuzz is one of the most famous programming question from interviews, which is generally used to weed out programmers who can't program. The problem is deceptively simple but you can't solve it if you don't know how to build programmin > read more

Webshpere MQ SSL Errors in Java - Solved

03/31/2015 09:31:00 AM

If you are working in Java application which is using WebSphere MQ for messaging over SSL then you are bound to face some setup, certificate and keystore vs truststore related error. For first timers understanding SSL and MQ errors is nightmare, forg > read more

What is Effectively Final variable of Java 8

03/30/2015 10:05:00 AM

Apart from big three, Lambda expression, Stream API and new Date and Time API, Java 8 has also introduced a new concept called "effectively final" variable. A non final local variable or method parameter whose value is never changed after initializat > read more

Parsing Large JSON Files using Jackson Streaming API Example

03/28/2015 00:14:00 AM

In last couple of JSON tutorials for Java programmers, we have learned how to parse JSON using JSON-Simple library, parsing JSON array to Java array using GSon, and in this tutorial we will learn how to parse a large JSON file in Java using Jackson&# > read more

How to reverse array in place in Java?

03/26/2015 09:35:00 AM

Reversing an array sounds pretty easy, isn't it? It does sounds like that, because all you need to do is create an array of same size, iterate through original array from end to start and populate your new array. Boom!!, you have got an array whi > read more

10 difference between Java and JavaScript for Programmers

03/23/2015 09:29:00 AM

Programmers, developers and internet users  have always been confused between Java and JavaScript.  Many people still thinks that JavaScript is part of Java platform, which is not true. In truth, JavaScript has nothing to do with Java, only common > read more

5 ways to Convert Java 8 Stream to List - Example, Tutorial

03/19/2015 09:47:00 AM

One of the common problem while working with Stream API in Java 8 is how to convert a Stream to List in Java because there is no toList() method present in Stream class. When you are processing a List using Stream's map and filter method, you ide > read more

Top 10 Popular Programming languages and their Creators

03/16/2015 09:05:00 AM

There are many programming languages out there in software world and they are still coming like Scala, Go, Closure etc, but only handful of them has managed to survive till date. These are the ones who has contributed immensely in software developmen > read more

How to find Largest Prime Factor of a Number in Java - Programming Kata

03/13/2015 09:58:00 AM

One of the common programming kata to learn coding is write a program to find the largest prime factor of a number. Like any other programming problem, you need to build the logic to solve this problem. Before solving the problem, let's revise th > read more

How to delete a directory with files in Java - Example

03/12/2015 10:23:00 AM

Deleting an empty directory is easy in Java, just use delete() method of class, but deleting a directory with files is unfortunately not easy. You just can't delete a folder if it contains files or sub folders. Calling delete() metho > read more

20 Examples of Date and Time API from Java 8

03/09/2015 08:52:00 AM

Along with lambda expressions, streams and several minor goodies, Java 8 has also introduced brand new Date and Time API, and in this tutorial we will learn how to use Java 8 Date Time API with simple how to do task examples. Java's handling of D > read more

How to Count Number of Words in String - Java Coding Exercise

02/27/2015 07:52:00 AM

String is very popular among Interviewer, and you are bound to see some questions on any programming interview, Java Interviews are no exception. Questions based from Java fundamentals like why String is Immutable in Java to questions based on coding > read more

How to Read File in One Line in JDK 7 or Java 8

02/24/2015 09:34:00 AM

Reading a file in Java is not simple, it requires lots of boiler plate code, as we have seen in our earlier example of reading text files. Various things had to wrapped e.g. a FileInputStream inside a BufferedReader, loops with weird terminating cond > read more

Top 16 jQuery Interview Questions Answers for JavaScript Programmers

02/23/2015 08:14:00 AM

Without a doubt, jQuery has given a much needed boost to JavaScript, a language so useful but equally underrated at times. Before jQuery comes into picture, we used to write lengthy JavaScript code not just for bigger but even for smaller functionali > read more

How to disable JUnit Test - @Ignore annotation Example

02/18/2015 06:36:00 AM

If you are using JUnit 4, then you can use @Ignore annotation to disable a test case; what this means is that, any method which is annotated by @Ignore, will not be executed by JUnit. Why would you want to disable a test? Well, It may be because tha > read more

Difference between UTF-8, UTF-16 and UTF-32 Character Encoding

02/17/2015 07:33:00 AM

Main difference between UTF-8, UTF-16 and UTF-32 character encoding is how many bytes it require to represent a character in memory. UTF-8 uses minimum one byte, while UTF-16 uses minimum 2 bytes. BTW, if character's code point is greater than 12 > read more

How to Find First and Last element of LinkedList Java - Doubly linked list

02/13/2015 22:20:00 PM

In this article you will learn how to get the first and last element of a linked list with the help of getFirst() and getLast() of LinkedList class. If you have programming or even gone to computer science course you probably know what is a linked li > read more

Difference between Right shift and Unsigned right shift in Java ( >> and >>> )

02/12/2015 09:24:00 AM

There are two types of right shift operator in Java >> and >>>,  former is known as right shift and later is known as right shift with zero fill or simply unsigned right shift operator in Java.  Though both of them are known as bit shift operators > read more

Constructor vs Init method in Servlet - JEE Interview Question

02/10/2015 09:00:00 AM

Can we have Constructor in Java Servlet? or Why do we need constructor in Servlet if there is already an init() method for initializing Servlet, or what is difference between init() method and constructor in Servlet are couple of questions I have se > read more

Simple JUnit Example - Unit Tests for Linked List in Java

02/09/2015 07:49:00 AM

From time to time, I have said that a Java programmer must write unit tests. IMHO, unit testing is the best development practice to improve code quality. Fortunately Java eco system has luxury of great unit testing frameworks in form of JUnit and Tes > read more

RandomAccessFile Example in Java : Read Write String

02/06/2015 08:19:00 AM

Random access file is a special kind of file in Java which allows non-sequential or random access to any location in file. This means you don't need to start from 1st line if you want to read line number 10, you can directly go to line 10 and rea > read more

How to Filter Collections in Java 8 with Streams and Predicates

02/04/2015 07:55:00 AM

Java 8 provides excellent features to support filtering of elements in Java Collections. Prior to Java 8, only better way to filter elements is by using foreach loop or iterating over Collection using Iterator and selecting required object, leaving o > read more

Top 50 Programmer Phone Interview Questions with Answers

02/02/2015 08:03:00 AM

It's 2015 now and from last few years phone interviews also known as telephonic round is the single most popular way to screen candidates in a programming job interview. It's easy for both parties to gauge each other, candidate don't need > read more

© 2006-2015, All Rights Reserved