Recent Updates: TIBCO RV FIX PROTOCOL JAVA TUTORIAL

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

Already a Member? Log In to Your Account
  
This Blog Posts All Posts Directory Listings Articles

15 Java Socket Programming, Networking Interview Questions and Answers

08/19/2014 07:49:00 AM

Networking and Socket Programming is one of the important area of Java programming language, especially for those programmers, who are working in client server based applications. Knowledge of important protocols e.g. TCP and UDP in detail is very im > read more

Bubble Sort Algorithm in Java with Example

08/14/2014 10:38:00 AM

Bubble Sort is the first sorting algorithm I learned during my college day, and after so many years it's the one I remember by heart. It's kind of weird that one of the most popular sorting algorithm is also one of the worst performing sortin > read more

How to find all Pairs in Array of Integers whose Sum is equal to a given Number

08/12/2014 08:22:00 AM

Practising coding problems are very important to do well in any programming interview. You should at your best on data-structures like array, linked list, and string to clear any programming interview, and believe me you can not do this in one day or > read more

Difference between getPath(), getCanonicalPath() and getAbsolutePath() of File in Java

08/08/2014 09:17:00 AM

File API is very important one in Java, it gives access of File system to Java programs. Though Java's file API is rich, there are lot of subtleties to know when you use them. One of the common query programmer's has about file path is differ > read more

5 Good Books to Learn Unit testing, JUnit and TDD for Java Developers

08/06/2014 08:18:00 AM

Unit testing is very, very important thing to learn adapt. I would say this is the single most practice in my book which differentiate a good programmer with a professional programmer. It's one way you can see how disciplined a programmer is? It& > read more

How to Send Email from Java Program with Example

08/04/2014 08:44:00 AM

Sending Email from Java program is a common requirement. It doesn't matter whether you are working on core Java application, web application or enterprise Java EE application, you may need to send email to alert support personal with errors, or j > read more

How to See difference between two Files in Eclipse - Text Comparision

08/01/2014 10:59:00 AM

One of the common task for every programmer is is to compare two files and find out difference between them. You would do this while comparing same file from different release version or from different environment to find out exactly what has changed > read more

How to Load Resources from Classpath in Java with Example

07/30/2014 09:15:00 AM

Classpath in Java is not only used to load .class files, but also can be used to load resources e.g. properties file, images, icons, thumbnails, or any binary content. Java provides API to read these resources as InputStream or URL. Suppose, you have > read more

Default, Defender or Extension Method of Java 8 with Example

07/28/2014 09:49:00 AM

Java 8 now allows you to add non-abstract method implementations to interfaces by utilizing the default and static keyword. Methods with default keyword are known as default methods or defender methods in Java. Before Java 8, it was virtually impossi > read more

Java ArrayList and HashMap Performance Improvement in JDK 1.7| Empty List and Map will Cost Less Memory

07/23/2014 09:18:00 AM

From long time one reason for me to update to newer Java version was always bug fix and performance improvement. Apart from major changes like Generics in Java 1.5 and Lambdas in Java 8, there are so many small improvements, performance optimization > read more

9 Difference between TCP and UDP Protocol - Java Network Interview Question

07/17/2014 09:44:00 AM

TCP and UDP are two transport layer protocols, which are extensively used in internet for transmitting data between one host to another. Good knowledge of how TCP and UDP works is essential for any programmer. That's why difference between TCP an > read more

How to Find Largest of Three Integers in Java - Algorithm, Logic Example

07/14/2014 09:58:00 AM

One of the classical program to build programming logic is, write a program to find largest of three numbers. I am sure many of you have already done this exercise in variety of languages including C, C++, C#, JavaScript, Perl, Ruby, PHP etc. This ti > read more

Write a Program to Find all Armstrong number in the range of 0 and 9999 - Example

07/10/2014 09:19:00 AM

An Armstrong number of three digits is an integer such that the sum of the cubes of its digits is equal to the number itself. For example, 153 is an Armstrong number, since 1**3 + 5**3 + 3**3 = 153, 371 is an Armstrong number since 3**3 + 7**3 + 1**3 > read more

Top 5 Java Performance Tuning Books - Best of Lot, Must read

07/08/2014 07:59:00 AM

Why Java developer should read a book on Performance tuning? When I first faced this question long time back, I thought I will do it later, but I never get back to that for a long time. I realize my mistake of having lack of knowledge on performance > read more

Top 50 Java Thread Interview Questions Answers for Freshers, Experienced Programmers

07/02/2014 08:28:00 AM

You go to any Java interview, senior or junior, experience or freshers,  you are bound to see couple of questions from thread, concurrency and multi-threading. In fact this built-in concurrency support is one of the strongest point of Java programmi > read more

How to create Custom Exception in Java - Tutorial Example

06/30/2014 08:54:00 AM

Sometime we need to create custom Exception in Java, i.e. Exceptions which are not defined in JDK or any third party library your application is using. Though it’s widely recommended on several Exception best practices article, even Joshua Bloch ha > read more

How to use CopyOnWriteArraySet in Java with Example

06/26/2014 08:09:00 AM

CopyOnWriteArraySet is little brother of CopyOnWriteArrayList class. These are special purpose collection classes which was added on JDK 1.5, along with their most popular cousin ConcurrentHashMap. They are part of concurrent collection framework and > read more

20 Fancy Acronyms Programmers should know?

06/23/2014 08:26:00 AM

Do you read blogs on Internet? Do you understand what TL;DR or ITT means, Well I didn't, not until last year. Internet is full of acronyms. Techies, programmers, developers and bloggers has developed a lot more fancy acronyms than you can think o > read more

How to Count number of Set bits or 1's in Integer on Java?

06/17/2014 09:55:00 AM

There are multiple ways to count number of 1's or set bits in a integer number in Java. You can use bitwise and bit shift operator by your own, or, you can use Java API to count number of set bits. Java 1.5 added two utility method called bitCoun > read more

Is Java Compiled or Interpreted Programming language?

06/11/2014 09:49:00 AM

One of the first question a graduate C or C++ programmer, who has just started learning Java ask is, whether Java is a compiled language or an interpreted one? On academic courses or during college, students learn a lot of languages e.g. VB, C, C++ a > read more

SynchronousQueue Example in Java - Produer Consumer Solution

06/09/2014 09:44:00 AM

SynchronousQueue is special kind of BlockingQueue in which each insert operation must wait for a corresponding remove operation by another thread, and vice versa. When you call put() method on SynchronousQueue it blocks until another thread is there > read more

Exception in thread "main" java.lang.ExceptionInInitializerError in Java Program

06/06/2014 09:23:00 AM

JVM throws java.lang.ExceptionInInitializerError, when there is an Exception inside static initializer block. If you know about static variable in Java, then you may know that they are initialized at the time of class loading. If there is an Exceptio > read more

2 Examples to read Zip Files in Java, ZipFile vs ZipInputStream

06/03/2014 08:27:00 AM

ZIP format is one of the most popular compression mechanism in computer world. A Zip file may contains multiples files or folder in compressed format.  Java API provides extensive support to read Zip files, all classes related to zip file processing > read more

jQuery Class and ID Selector Example Tutorial

05/31/2014 08:02:00 AM

One of the best thing of jQuery is there selectors, which gives jQuery enormous power to find and select DOM elements so easily. If you are coming from JavaScript background then you might love those classical methods e.g. getElementById() and getEle > read more

Law of Demeter in Java - Principle of least Knowledge - Real life Example

05/28/2014 08:50:00 AM

Law of Demeter also known as principle of least knowledge is a coding principle, which says that a module should not know about the inner details of the objects it manipulates. If a code depends upon internal details of a particular object, there is > read more

Double Checked Locking on Singleton Class in Java

05/26/2014 09:47:00 AM

Singleton class is quite common among Java developers, but it poses many challenges to junior developers. One of the key challenge they face is how to keep Singleton class as Singleton? i.e. how to prevent multiple instances of a Singleton due to wha > read more

Why use SerialVersionUID inside Serializable class in Java

05/22/2014 10:42:00 AM

Serialization and SerialVersionUID is always remains a puzzle for many Java developers. I often see questions like what is this SerialVersionUID, or what will happen if I don't declare SerialVersionUID in my Serializable class? Apart from complex > read more

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 5 - Solving Array IndexOutOfBoundsException in Java

05/19/2014 09:40:00 AM

If you are coming from C background than there is pleasant surprise for you, Java programming language provides implicit bound checks on Array, which means an invalid array index access is not allowed in Java and it will result in java.lang.ArrayInde > read more

How to find Prime Factors of Integer Numbers in Java - Factorization

05/16/2014 10:41:00 AM

One of the common homework/task in programming courses is about Prime Factorization. You are asked to write a program to find prime factors of given integer number. The prime factors of a number are all of the prime numbers that will exactly divide > read more

10 Articles Every Programmer Must Read

05/13/2014 09:35:00 AM

Being a Java programmer and Software developer, I have learned a lot from articles titled as What Every Programmer Should Know about ..... , they tend to give a lot of useful and in-depth information about a particular topic, which otherwise is very > read more

tibrvnative.dll : Can't load IA 32-bit .dll on a AMD 64-bit platform - Windows 8

05/10/2014 09:44:00 AM

Can't load IA 32-bit .dll on a AMD 64-bit platform is a generic error, which comes when a 64-bit process tries to load a 32-bit dll, but when it comes its not that easy to resolve. One of my reader was getting this error tibrvnative.dll : Can' > read more

Open source Java Libraries to Create PDF documents - iText vs Apache FOP

05/07/2014 09:19:00 AM

PDF format is a popular format for sending receipt, email confirmation and other documentation and we often has requirement to create PDF documents using Java, mostly in JSP pages. Since most of official documentation uses PDF format now days, it bec > read more

How String in Switch works in Java 7

05/05/2014 09:16:00 AM

Ever Since Java allows using String variable in switch and case statements, there are many programmers using this feature in code, which can be better written using integer and enum pattern. This was one of the popular features of JDK 7 release, inc > read more

Top 5 Cloud Service Providers and Companies, Java IT professionals Should Know

05/02/2014 08:58:00 AM

Cloud computing is Hot, it's the biggest IT trend of last few years and will continue to grow strong in coming future. Cloud computing provides several not-so-easy-to-ignore advantages, especially to public and small enterprises, which cannot aff > read more

Difference between Connected vs Disconnected RowSet in Java JDBC | RowSetProvider, RowSetFactory Example

04/28/2014 08:53:00 AM

RowSet interface is another key interface from JDBC API, which extends the ResultSet interface to provide support for the JavaBean component model. Along with convenient methods to set connection parameters e.g. setUrl(), setUsername(), setPassword() > read more

How to Convert Byte Array to InputStream and OutputStream in Java

04/25/2014 09:52:00 AM

Are you stuck with your coding because you have a byte array and next method in chain needs an InputStream? don't worry Java has solution for that, You can use ByteArrayInputStream to convert byte array to InputStream in Java. This class takes a > read more

Difference between State and Strategy Design Pattern in Java

04/22/2014 09:30:00 AM

In order to make proper use of State and Strategy design Pattern in Core Java application, its important for a Java developer to clearly understand difference between them. Though both State and Strategy design patterns has similar structure, and bot > read more

10 JDK 7 Features to Revisit, Before You Welcome Java 8

04/15/2014 09:13:00 AM

It's been almost a month Java 8 is released and I am sure all of you are exploring new features of JDK 8. But, before you completely delve into Java 8, it’s time to revisit some of the cool features introduced on Java 7. If you remember, Java 6 > read more

How to fix org.hibernate.MappingException: Unknown entity Exception in Java

04/12/2014 23:45:00 PM

If you have used Hibernate with JPA and using annotation to declare your entity bean then you might have seen this confusing error called "org.hibernate.MappingException: Unknown entity". This error message is so misleading that you could easily lose > read more

Difference between FileInputStream and FileReader in Java | InputStream vs Reader

04/10/2014 08:38:00 AM

Before going to explain specific difference between FileInputStream and FileReader in Java, I would like to state fundamental difference between an InputStream and a Reader in Java, and when to use InputStream and when to go for Reader. Actually, Bot > read more

For Each loop Puzzle in Java

04/09/2014 01:54:00 AM

From Java 5 onwards, we have a for-each loop for iterating over collection and array in Java. For each loop allows you to traverse over collection without keeping track of index like traditional for loop, or calling hasNext() method in while loop usi > read more

Dealing with org.hibernate.LazyInitializationException: could not initialize proxy - no Session in Hibernate Java

04/06/2014 02:50:00 AM

If you are working in Hibernate framework, then you know that one of the key feature of Hibernate is "lazy initialization", which allows framework to lazily initialize dependencies, relationship or association lazily from database on need basis. For > read more

How to replace line breaks , New lines from String in Java.- Windows, Mac or Linux

04/04/2014 10:02:00 AM

We often need to replace line terminator characters, also known as line breaks e.g. new line n and carriage return r with different characters. One of the common case is to replace all line breaks with empty space in order to concatenate multiple l > read more

Difference between Stub and Mock object in Java Unit testing - JUnit

04/02/2014 08:51:00 AM

JUnit is the most popular framework for unit testing Java code. Unit testing is used to test a single programming unit e.g. a class or a method, in-fact many Java developer write unit test on per method basis. Stub and Mock objects are two concepts w > read more

How to use EnumSet in Java with Example

03/31/2014 09:55:00 AM

EnumSet is one of the specialized implementation of Set interface for enumeration type, introduced in Java 1.5 along with enumeration type itself. Programmer often stores Enum into common collection classes e.g. HashSet or ArrayList, mostly because t > read more

Hibernate NullPointerException due to Space in HQL named queries

03/29/2014 00:05:00 AM

If you are using Hibernate for implementing persistence layer in Java and JEE application from couple of years then you would have seen this notorious NullPointerException while executing HQL named queries, Exception in thread “main” java.lang.Nu > read more

3 ways to Find First Non Repeated Character in a String - Java Programming Problem

03/27/2014 09:44:00 AM

Write a Java program to find first non repeated character in a String is a common question on coding tests. Since String is a popular topic in various programming interviews, It's better to prepare well with some well-known questions like reversi > read more

Difference between WeakReference vs SoftReference vs PhantomReference vs Strong reference in Java

03/25/2014 09:53:00 AM

WeakReference and SoftReference were added into Java API from long time but not every Java programmer is familiar with it. Which means there is a gap between where and how to use WeakReference and SoftReference in Java. Reference classes are particu > read more

Binary Search vs Contains Performance in Java List

03/21/2014 10:18:00 AM

There are two ways to search an element in a List class, by using contains() method or by using Collections.binarySearch() method. There are two versions of binarySearch() method, one which takes a List and Comparator and other which takes a List and > read more

2 Examples of Streams with Collections in Java 8

03/19/2014 08:44:00 AM

Finally Java 8 is here, after more than 2 years of JDK 7, we have a much expected Java 8 with lots of interesting feature. Though Lambda expression is the most talked item of coming Java 8 release, it wouldn't have been this much popular, if Coll > read more

How to Check if a Number is Binary in Java - Programming Problem

03/17/2014 08:35:00 AM

Today we will take a look on another simple programming exercise, write a program to check if a number is binary in Java. A number is said to be binary if it only contains either 0 or 1, for example 1010 is binary number but 1234 is not. You can not > read more

Why use Underscore in Numbers from Java SE 7 - Underscore in Numeric Literals

03/13/2014 09:14:00 AM

JDK 1.7 release had introduced several useful features, despite most of them being syntactic sugar, there use can greatly improve readability and code quality. One of such feature is introduction of underscore in numeric literals. From Java 7 onwards > read more

How to Clone Collection in Java - Deep copy of ArrayList and HashSet

03/11/2014 09:13:00 AM

Programmer often mistook copy constructors provided by various collection classes, as a mean to clone Collection e.g. List, Set, ArrayList, HashSet or any other implementation. What is worth remembering is that, copy constructor of Collection in Java > read more

Top 10 MQ Series Interview Questions Answers - WebSphere and Active MQ

03/05/2014 07:32:00 AM

MQ Series Interview Questions and Answers are collection of some of the questions asked on various MQ implementation e.g. IBM WebSphere MQ, Active MQ or Sonic MQ from different core Java and Enterprise Java (JEE) interviews. Most of these questions a > read more

Covariant Method Overriding of Java 5 - Coding Best Practices

03/03/2014 07:24:00 AM

Sometime knowledge of a specific Java feature can improve code quality, Covariant method overriding is one of such feature. Covariant method overriding was introduced in Java 5, but it seems it lost between other more powerful features of that releas > read more

Why Catching Throwable or Error is bad?

02/28/2014 07:10:00 AM

We often hear advice that catching Throwable or Error is bad practice and Java developer should avoid catching these, but have you thought Why? If language allows you to catch anything which is instance of java.lang.Throwable, then what is the proble > read more

10 Example of Lambda Expressions and Streams in Java 8

02/26/2014 08:22:00 AM

Java 8 release is just a couple of weeks away, scheduled at 18th March 2014, and there is lot of buzz and excitement about this path breaking release in Java community. One of feature, which is synonymous to this release is lambda expressions, which > read more

How to Format and Display Number to Currency in Java - Example Tutorial

02/24/2014 06:58:00 AM

Displaying financial amount in respective currency is common requirement in Java based E-commerce applications. For example if you are selling products on-line globally, you will show price of product in their local currency rather than USD or some o > read more

Fixing java.net.BindException: Cannot assign requested address: JVM_Bind in Tomcat, Jetty

02/21/2014 08:57:00 AM

Some of the most dreaded error in Java based client server based application is networking related error, e.g. java.net.BindException: Cannot assign requested address: JVM_Bind. I have faced this issue, while working with web servers like Tomcat, Jet > read more

Top 30 Java Phone Interview Questions Answers for Freshers, 1 to 2 Years Experienced

02/19/2014 08:57:00 AM

In this article, I am sharing 30 core Java technical questions, from screening and phone round of interviews. In telephonic interviews, questions are short, fact based and Interviewer expects some keyword in answers. Accordingly, I have given very sh > read more

How to Create Tabs UI using HTML, CSS, jQuery, JSP and JavaScript

02/17/2014 07:06:00 AM

JSP is still a popular technology for developing view part of Struts and Spring based Java application, but unfortunately it doesn't have rich UI support available in GWT, or any other library. On other day, we had a requirement to display HTML > read more

Why Static Code Analysis is Important?

02/14/2014 07:00:00 AM

From last few years, Software code quality and security has went from being a “nice to have” to a necessity, and many organizations, including investment banks are making it mandatory to pass static code analysis test, penetration testing and sec > read more

Display tag Pagination, Sorting Example in JSP and Servlet

02/11/2014 08:12:00 AM

If you are a Java programmer, writing JSP pages for your web application and doesn't know much about JavaScript, jQuery, CSS and HTML, then display tag is best for creating dynamic tables, pagination, sorting, and exporting data into PDF, Word an > read more

Java Comparable Example for Natural Order Sorting

02/07/2014 21:50:00 PM

Java allows you to sort your object in natural order by implementing Comparable interface. It's one of the fundamental interface of Java API and defined in java.lang package, which means you don't need to implement this unlike its counterpart > read more

Difference between Association, Composition and Aggregation in Java, UML and Object Oriented Programming

02/05/2014 09:52:00 AM

In Object-oriented programming, one object is related to other to use functionality and service provided by that object. This relationship between two object is known as association in  object oriented general software design, and depicted by an arr > read more

StringTokenizer Example in Java with Multiple Delimiters

02/02/2014 01:20:00 AM

StringTokenizer is a legacy class for splitting strings into tokens. In order to break String into tokens, you need to create a StringTokenizer object and provide a delimiter for splitting string into tokens. You can pass multiple delimiter e.g. you > read more

Top 5 Hibernate Books for Java Developers - Best, Must read

01/28/2014 08:09:00 AM

Hibernate is one of the most popular, open source ORM (Object Relational Mapping) framework, which has now become an standard for developing persistence layer on Java enterprise application, along with JPA (Java Persistence API). I often receive requ > read more

Java Comparator Example for Custom Sorting Employee by Name, Age and Salary

01/24/2014 22:48:00 PM

In this tutorial, we will see Java Comparator example to sort an Employee object by name, age and salary. In order to sort Employee object on different criterion, we need to create multiple comparators e.g. NameComparator, AgeComparator and SalaryCom > read more

10 Tips to Improve Programming Skill and become better Programmer, Developer

01/21/2014 08:52:00 AM

Many Java developers ask me How to become better programmer, how do I improve my programming skills, or I am good at Java but not so good on problem solving skill etc. This is reality, today's era is full of language expert than real programmers. > read more

Eclipse Not Able To Connect Internet, Market Place - Configure Connection Proxy Settings

01/18/2014 07:14:00 AM

If you are using Eclipse in your company, you might have faced issues, where Eclipse is not able to connect to internet. Since most of companies uses proxy for connecting to Internet, its important to configure proxy settings in Eclipse to allow Ecli > read more

Why Default or No Argument Constructor is Important in Java Class

01/15/2014 08:13:00 AM

Almost all Java developers knows that compiler adds a default constructor or better known as no argument constructor in every Java class, but many of them forget that, it only does when you don't provide any other constructor. Which means it beco > read more

Why Java Certifications are Good for Freshers and Junior Developers?

01/11/2014 04:31:00 AM

I have seen many Java programmers in doubt whether to go for certifications or not? Should I go for OCPJP 7 or not, is a common doubt among young graduate and a Java developer with few years of experience under his belt. Well, getting certified and r > read more

Top 5 Free Scala Programming Books for Java Programmers, Download as PDF or Read Online

01/08/2014 08:00:00 AM

Scala is another JVM based programming language, which is quickly gaining popularity because of its interesting mix of object oriented and functional programming paradigm. Many companies has started using Scala for there strategic and mission critica > read more

How to Remove Objects from Collection or ArrayList in Java while Traversing - Iterator remove() method Example

01/06/2014 07:48:00 AM

How do you remove objects from Java collections like ArrayList, while iterating is one of the frequent questions my reader asked to me in my post about Top 25 Java Collection Interview Questions. Well, this question may seems quite easy, because eve > read more

How to Remove Duplicates from Array without using Java Collection API

01/04/2014 00:32:00 AM

This is a coding questions recently asked to one of my reader in a Java Technical interview. Question was to remove duplicates from an integer array without using any collection API classes like Set or LinkedHashSet, which can make this task trivial. > read more

Does Java Certifications like SCJP, OCJP or OCPJP helps in Job and Career?

01/01/2014 08:34:00 AM

First of all, Wish you very Happy New Year 2014 !!, May god brings success to you all. I receive lots of questions about usefulness of Java certifications like SCJP, now known as OCJP or OCPJP. Questions like, does doing Java Certification helps land > read more

Inter Thread Communication in Java using Wait Notify Example

12/30/2013 06:43:00 AM

Wait and notify methods in Java are used for inter-thread communication i.e. if one thread wants to tell something to another thread, it uses notify() and notifyAll() method of java.lang.Object. Classical example of wait and notify method is Producer > read more

How to redirect a page or URL using JavaScript and JQuery

12/25/2013 06:24:00 AM

Redirecting a web page means, taking user to new location. Many website use redirect for many different reasons, e.g. Some website redirect user from old domain to new domain, some redirect from one page to another e.g. a more relevant page. If you a > read more

JUnit Testing Tips - Constructor is Called Before Executing Test Methods

12/19/2013 08:20:00 AM

Most of Java programmers either use JUnit or TestNG for there unit testing need, along with some mock object generation libraries e.g. Mockito, but not everyone spend time and effort to learn subtle details of these testing libraries, at least not in > read more

How to configure Log4j in Java program without XML or Properties File

12/12/2013 08:18:00 AM

Sometime configuring Log4j using XML or properties file looks annoying, especially if your program not able to find them because of some classpath issues, wouldn't it be nice if you can configure and use Log4j without using any configuration file > read more

When to make a method final in Java

12/04/2013 08:40:00 AM

Final keyword in Java is not as mysterious as volatile or transient, but still it creates lot of doubts on programmers mind. I often receives questions like, When to make a method final in Java or When to make a method static in Java, later I answere > read more



© 2006-2014 OnToplist.com, All Rights Reserved