Blog Feed: TIBCO RV FIX PROTOCOL JAVA TUTORIAL

Blog Feed: TIBCO RV FIX PROTOCOL JAVA TUTORIAL

Already a Member? Log In to Your Account


10 points about .class file in Java

Published on 2012-05-26 00:00:00

.class file in Java is core of achieving platform independence which is key feature of Java. class files are compiled form of any Java program written in byte codes. Since Java program executes inside JVM, these instructions are read by JVM and than translated into machine code for underlying platform. effectively you can run class file on any platform if you have a corresponding JVM supported for that platform. Java compilers are responsible for generating .class file and they follow class file [..] > read more

How to access private field and method using Reflection in Java

Published on 2012-05-25 08:08:00

Reflection in Java is very powerful feature and allows you to access private method and fields which is not possible by any other means in Java and because of this feature of reflection many code coverage tool, static analysis tool and Java IDE like Eclipse and Netbeans has been so helpful. In last article we have seen details about private keyword in Java and learned  why we should always make fields and method private in Java. There we have mentioned that private fields and methods are only a [..] > read more

How to copy file in Java Program example tutorial

Published on 2012-05-25 00:03:00

How to copy file in Java from one directory to another is common requirement, given that there is no direct method in File API for copying files from one location to another. Painful way of copying file is reading from FileInputStream and writing same data to FileOutputStream to another directory. Though this process works its pretty raw to work with and best approach is for anyone to create library for common File operation like cut, copy, paste etc. Thankfully you don't need to reinvent wh [..] > read more

Different types of JDBC drivers in Java - Quick overview

Published on 2012-05-24 06:48:00

How many types of JDBC drivers in Java is a classical JDBC interview question , though I have not see this question recently but it was very popular during 2006 - 2008 period and still asked mostly on Junior programmer level interviews. There are mainly 4 types of JDBC drivers in Java, those are referred as type 1 to type 4 jdbc drivers. I agree its easy to remember them by type rather than with there actual name, Which I have yet to get in memory except plain old JDBC-ODBC bridge driver. By the [..] > read more

break continue and label in loop – Java program example

Published on 2012-05-23 08:56:00

break and continue in Java are two essential keyword beginners needs to familiar while using loops ( for loop, while loop and do while loop). break statement in java is used to break the loop and transfers control to the line immediate outside of loop while continue is used to escape current execution and transfers control back to start of the loop. Both break and continue allows programmer to create sophisticated algorithm and looping constructs. In this java tutorial we will see example of bre [..] > read more

What is Bean scope in Spring MVC framework with Example

Published on 2012-05-22 07:36:00

Bean scope in Spring framework or Spring MVC are scope for a bean managed by Spring IOC container. As we know that Spring is a framework which is based on Dependency Injection and Inversion of Control and provides bean management facilities to Java application. In Spring managed environment bean (Java Classes) are created and wired by Spring framework. Spring allows you to define how those beans will be created and scope of bean is one of those details. This Spring tutorial is next on my earlier [..] > read more

Counting Semaphore Example in Java 5 – Concurrency Tutorial

Published on 2012-05-21 09:27:00

Counting Semaphore in Java is a synchronizer which allows to impose a bound on resource is added in Java 5 along with other popular concurrent utilities like CountDownLatch, CyclicBarrier and Exchanger etc. Counting Semaphore in Java maintains specified number of pass or permits, In order to access a shared resource, Current Thread must acquire a permit. If permit is already exhausted by other thread than it can wait until a permit is available due to release of permit from different thread. Thi [..] > read more

5 Difference between Application Server and Web Server in Java

Published on 2012-05-18 09:30:00

Application server and web server in Java both are used to host Java web application. Though both application server and web server are generic terms, difference between application server and web server is a famous J2EE interview question. On  Java J2EE perspective main difference between web server and application server is support of EJB. In order to run EJB or host enterprise Java application (.ear) file you need an application server like JBoss, WebLogic, WebSphere or Glassfish, while you [..] > read more

Difference between java and javaw executable commands

Published on 2012-04-28 22:37:00

difference between java.exe and javaw.exe commands was the recent java question asked to one of my friend. while running java program on windows you might have noticed that they will appear in task manager as either java.exe or javaw.exe,  also in JAVA_HOME/bin we see these two java commands java.exe and javaw.exe, do you know difference between java.exe and javaw.exe ? surprisingly not many java programmer know answer of this java interview question, may be because java developers has not paid [..] > read more

Java program to reverse a number - Example tutorial

Published on 2012-04-19 14:00:00

How to reverse a number in Java without using any API or write a simple Java program to reverse a number is common programming questions asked on fresher level software engineer interviews. Reversing a number is also popular homework questions on many Java programming courses on school, colleges and training institutes. I personally feel java program to reverse number is good programming exercise for some one who is just started learning programming in Java or any other programming language beca [..] > read more

How to measure elapsed execution time in Java - StopWatch Example

Published on 2012-04-18 13:00:00

There are two ways to measure elapsed execution time in Java either by using System.currentTimeinMillis()or by using  System.nanoTime(). These two methods can be used to measure elapsed or execution time between two method calls or event in Java. Calculating elapsed time is one of the first thing Java programmer do to find out how many seconds or millisecond a method is taking to execute or how much time a particular code block is taking. Most of Java programmer are familiar with System.current [..] > read more

Difference between List and Set in Java Collection

Published on 2012-04-17 03:09:00

What is difference between List and Set in Java is a very popular Java collection interview questions and an important fundamental concept to remember while using Collections class in Java. Both List and Set are two of most important Collection classes Java Program use along with various Map implementation. Basic feature of List and Set are abstracted in List and Set interface in Java and then various implementation of List and Set adds specific feature on top of that e.g. ArrayList in Java is a [..] > read more

How to invoke method by name in java dynamically using reflection

Published on 2012-04-16 12:55:00

In Java you can invoke any method by its string name dynamically using reflection API. java.lang.reflect API provides powerful reflection mechanism which can load classes by its name even if classes are not available at compile time, Can get all methods including private and public from class and allow you to invoke any method dynamically using reflection. For those who are new in Java this sound pretty strange that at runtime you provide a method name using string and Java can run that method w [..] > read more

Difference between java.util.Date and java.sql.Date in Java - JDBC Question

Published on 2012-04-15 12:17:00

Difference between java.util.Date and java.sql.Date in Java or why does Java has java.sql.Date if there is already a Date class in java util package is a common java interview question. There is always confusion among many Java developer familiar with both java.util.Date and java.sql.Date. Though many of them already using java.sql.Date to interface with DATE type of any relational database like mysql, oracle or any other database. In this Java tutorial we will see some differences between java. [..] > read more

How to convert local time to GMT in Java Program Example tutorial code

Published on 2012-04-14 12:00:00

Converting local time into GMT or any other timezone in Java is easy as Java has support for time zones. JDK has a class called java.util.Timezone which represents timezone and Java also has classes like SimpleDateFormat which can use Time zone while parsing or formatting dates. By using java.uti.TimeZone and java.text.SimpleDateFormat we can write simple Java program to convert local time to GMT or any other time zone in Java. We have already seen example of How to get current date and time in [..] > read more

Java Program to connect Oracle Database with Example - JDBC Tutorial Sample Code

Published on 2012-04-13 22:17:00

How to connect to Oracle database from Java Program using JDBC API is common need for many Java programmer, though there are lot of framework available which has simplified JDBC development e.g hibernate, Spring JdbcTempate and many more, but creating Java program to connect to oracle database from plain old Java is still most easy and quickest method for testing and debugging database connectivity. Database connection program is also a common Java programming exercise in many Java programming c [..] > read more

Java PropertyUtils Example - getting and setting properties by name

Published on 2012-04-13 10:09:00

PropertyUtils class of Apache commons beanutils library is very useful and provides you ability to modify properties of Java object at runtime. PropertyUtils enables you to write highly configurable code where you can provide name of bean properties and there values from configuration rather than coded in Java program and Apache PropertyUtils can set those properties on Java object at runtime. One popular example of how powerful PropertyUtils can be is display tag which provides rich tabular dis [..] > read more

Java Program to find factorial of number in Java - Example Tutorial

Published on 2012-04-13 09:04:00

How to find factorial of a number in Java on both recursive and iterative way is a common Java interview question mostly asked at fresher level. It’s not just popular on Java interview but also on other programming language like C or C++. Its also famous  In our last article we have seen how to check if a number is prime or not and in this Java programming tutorial we will see a simple Java program to find factorial of a number in Java by using recursion and iteration. Same program can also b [..] > read more

Java Program to print Prime numbers in Java - Example Tutorial and Code

Published on 2012-04-13 07:14:00

How to print Prime numbers in Java or how to check if a number is prime or not is classical Java programming questions, mostly taught in Java programming courses. A number is called prime number if its not divisible by any number other than 1 or itself and you can use this logic to check whether a number is prime or not. This program is slightly difficult than printing even or odd number which are relatively easier Java exercises. This Simple Java program print prime number starting from 1 to 10 [..] > read more

What is bounded and unbounded wildcards in Generics Java

Published on 2012-04-06 01:41:00

Bounded and unbounded wildcards in Generics are two types of wildcard available on Java. Any Type can be bounded either upper or lower of class hierarchy in Generics by using bounded wildcards. In short and represent bounded wildcards while represent an unbounded wildcard in generics . In our last article How Generics works in Java , we have seen some basic details about bounded and unbounded wildcards in generics and In this Java tutorial we will see bounded and unbounded generics wildcards [..] > read more

10 points on interface in Java with Example - Tutorial

Published on 2012-04-05 20:31:00

Interface in java is core part of its programming language despite that many programmers thinks Java Interface as an advanced concept and refrain using interfaces from early in programming career. At very basic level  interface  in java is a keyword  but same time it is an object oriented term to define contracts and abstraction , This contract is followed by any implementation of Interface in Java. Since multiple inheritance is not allowed in Java,  interface is only way to implement multip [..] > read more

How to find current directory in Java with Example

Published on 2012-04-01 04:56:00

Its easy to get current directory in Java by using built-in system property provided by Java environment. Current directory represent here the directory from where "java" command has launched. you can use "user.dir" system property to find current working directory in Java. This article is in continuation of my earlier post on Java e.g. How to load properties file in Java on XML format or How to parse XML files in Java using DOM parser and Why Java doesn’t support multiple inheritance . If you [..] > read more

Private in Java: Why should you always keep fields and methods private?

Published on 2012-03-31 04:10:00

Making members private in Java is one of best coding practice. Private members (both fields and methods) are only accessible inside the class they are declared or inside inner classes. private keyword is one of four access modifier  provided by Java and its a most restrictive among all four e.g. public, default(package), protected and private. Though there is no access modifier called package, rather its a default access level provided by Java. In this Java tutorial we will see why should we al [..] > read more

How to Compare two String in Java - String Comparison Example

Published on 2012-03-29 22:20:00

String comparison is a common programming task and Java provides several way to compare two String in Java. String is a special class in Java, String is immutable and It’s used a lot in every single Java program starting from simple test to enterprise Java application. In this Java String compare tutorial we will see different ways to compare two String in Java and find out how they compare String and when to use equals() or compareTo() for comparison etc. Here are four examples of comparing [..] > read more

How to loop ArrayList in Java - Code Example

Published on 2012-03-28 21:45:00

Looping ArrayList in Java or Iteration over ArrayList is very similar to looping Map in Java. In order to loop ArrayList in Java we can use either foreach loop, simple for loop or Java Iterator from ArrayList. We have already touched iterating ArrayList in 10 Example of ArrayList in Java and we will see here in detail. We are going to see examples of all three approaches in this ArrayList tutorial and find out which one is clean and best method of looping arraylist in Java. Before start writing [..] > read more

Difference between start and run method in Thread – Java Tutorial

Published on 2012-03-25 01:01:00

Why do one call start method of thread if start() calls run() in turn" or "What is difference by calling start() over run() method in java thread" are two widely popular beginner level multi-threading interview question. When a Java programmer start learning Thread, first thing he learns is to implement thread either overriding run() method of Thread class or implementing Runnable interface and than calling start() method on thread, but with some experience he finds that start() method calls run [..] > read more

Why use PreparedStatement in Java JDBC – Example Tutorial

Published on 2012-03-24 05:36:00

PreparedStatement in Java is one of several ways to execute SQL queries using JDBC API. Java provides Statement,PreparedStatement and CallableStatement for executing queries. Out of these three, Statement is used for general purpose queries, PreparedStatement is used for executing parametric query and CallableStatement is used for executing Stored Procedures. PreparedStatement is also a popular topic in java interviews. Questions like Difference between Statement and PreparedStatement in Java an [..] > read more

SimpleDateFormat in Java is not Thread-Safe Use Carefully

Published on 2012-03-23 21:48:00

SimpleDateFormat in Java  very common and used to format Date to String and parse String into Date in Java but it can cause very subtle and hard to debug issues if not used carefully because DateFormat and SimpleDateFormat both are not thread-safe and buggy. call to format() and parse() method mutate state of DateFormat class and should be synchronized externally in order to avoid any issue. here are few points which you should take care while using SimpleDateFormat in Java: Read more » Java, [..] > read more

How to find file and directory size in Unix with Example - Linux tutorial

Published on 2012-03-23 10:39:00

How to find size of directory in unixFinding file size or directory size in Unix and Linux is not very difficult but if you came from windows background than it may sounds difficult to you because you need to remember unix commands for file and directory size. This is a common complain from windows user when they exposed to Unix operating system be it Linux or Solaris. but In my opinion having commands for doing things is more powerful because you can write powerful scripts for removing large fi [..] > read more

Difference between transient and volatile keyword in Java

Published on 2012-03-23 00:17:00

Surprisingly "Difference between transient and volatile keyword in Java" has asked many times on various java interview. volatile and transient are two completely different keywords from different areas of Java programming language. transient keyword is used during serialization of Java object while volatile is related to visibility of variables modified by multiple thread during concurrent programming. Only similarity between volatile and transient is that they are less used or uncommon keyword [..] > read more

How to fix java.io.FileNotFoundException: (Access is denied)

Published on 2012-03-22 23:46:00

Earlier my impression was that java.io.FileNotFoundException: (Access is denied) comes when you try to read a text or binary file for which you don't have permission from Java program but this can also come while you are using jar command. jar command internally use java.util.zip.ZipFile class to open any jar or war file which can throw java.io.FileNotFoundException: (Access is denied). I was trying to see contents of war file which was created using recent build when I stumble upon this err [..] > read more

Spring Security Example Tutorial - How to limit number of User Session in Java J2EE

Published on 2012-03-22 23:10:00

Spring security can limit number of session a user can have. If you are developing web application specially secure web application in Java J2EE then you must have come up with requirement similar to online banking portals have e.g. only one session per user at a time or no concurrent session per user. You can also implement this functionality without using spring security but with Spring security its just piece of cake with coffee :). Spring Security provides lots of Out of Box functionality a [..] > read more

What is Daemon thread in Java and Difference to Non daemon thread - Tutorial Example

Published on 2012-03-16 22:53:00

Daemon thread in Java are those thread which runs in background and mostly created by JVM for performing background task like Garbage collection and other house keeping tasks. Difference between Daemon and Non Daemon(User Threads)  is also an interesting multi-threading interview question, which asked mostly on fresher level java interviews. In one line main difference between daemon thread and user thread is that as soon as all user thread finish execuction java program or JVM terminates itsel [..] > read more

How to get ServletContext in Servlet, JSP, Action class and Controller.

Published on 2012-03-16 21:46:00

How to get ServletContext in Servlet, jsp, spring controller or struts action class is common need of any Java web developer. As ServletContext is an application wide object and used to store variables in global scope, getting a reference of ServletContext is pretty important. Every web application can have only one ServletContext though they can have multiple ServletConfig object. In this article we will see : How to get Servlet Context inside Spring MVC Controller?How to find  Servlet Contex [..] > read more

Why character array is better than String for Storing password in Java

Published on 2012-03-15 08:34:00

Why character array is better than String for storing password in Java was recent question asked to one of my friend in a java interview. he was interviewing for a Technical lead position and has over 6 years of experience.Both Character array and String can be used to store text data but choosing one over other is difficult question if you haven't faced the situation already. But as my friend said any question related to String must have a clue on special property of Strings like immutabili [..] > read more

Mixing static and non static synchronized method - Java mistake 2

Published on 2012-03-13 09:22:00

Using static and non static synchronized method for protecting shared resource is another Java mistake we are going to discuss in this part of  our series “learning from mistakes in Java”. In last article we have seen why double and float should not be used for monetary calculation , In this tutorial we will find out why using static and non static synchronized method together for protecting same shared resource is not advisable. I have seen some times Java  programmer mix static synchron [..] > read more

What is GET and POST method in HTTP and HTTPS Protocol

Published on 2012-03-11 07:34:00

GET and POST method in HTTP and HTTPS ProtocolGET and POST method in HTTP and HTTPS are two most popular methods used to transfer data from client to server using  HTTP(Hyper Text Transfer Protocol)  protocol. Both GET and POST can be used to send request and receive response but there are significant difference between them. Difference between GET and POST in HTTP or HTTPS is also a popular interview question in JSP and any web programming interview. Since HTML is independent of any web serve [..] > read more

What is Static and Dynamic binding in Java with Example

Published on 2012-03-10 22:24:00

Static and dynamic binding  in Java are two important concept which Java programmer should be aware of. this is directly related to execution of code. If you have more than one method of same name (method overriding) or two variable of same name in same class hierarchy it gets tricky to find out which one is used during runtime as a result of there reference in code. This problem is resolved using static and dynamic binding in Java. For those who are not familiar with binding operation, its pro [..] > read more

10 points on finalize method in Java – Tutorial Example

Published on 2012-03-10 04:12:00

finalize method in java is a special method much like main method in java. finalize() is called before Garbage collector reclaim the Object, its last chance for any object to perform cleanup activity i.e. releasing any system resources held, closing connection if open etc. Main issue with finalize method in java is its not guaranteed by JLS that it will be called by Garbage collector or exactly when it will be called, for example an object may wait indefinitely after becoming eligible for garbag [..] > read more

What is Encapsulation in Java and OOPS with Example

Published on 2012-03-10 00:06:00

Encapsulation in Java or object oriented programming language is a concept which enforce protecting variables, functions from outside of class, in order to better manage that piece of code and having least impact or no impact on other parts of program duec to change in protected code. Encapsulation in Java is visible at different places and Java language itself provide many construct to encapsulate members. You can completely encapsulate a member be it a variable or method in Java by using priva [..] > read more

10 example of chmod command in UNIX Linux

Published on 2012-03-09 22:16:00

chmod command in UNIX or Linux is used to change file or directory permissions. This is one of many UNIX basic commands which a UNIX or Linux user must be familiar with. In this UNIX command tutorial we will see how to change file permissions using chmod command, what are file permissions in UNIX, how to change permissions of directory and sub-directory using UNIX chmod command and finally how to create executable files in UNIX using chmod command. Before going directly into examples of chmod co [..] > read more

Top 10 EJB Interview Question and Answer asked in Java J2EE Interviews

Published on 2012-03-08 07:35:00

10 EJB Interview Questions and Answer from my collection of interview questions. I have been sharing interview questions on various topics like Singleton interview question, serialization interview question and most recently Spring interview questions. No doubt these questions are very important from performing better in J2EE and EJB interviews but also they open new path for learning as you may find some concept new even while revising your knowledge in EJB. EJB interviews has always been tough [..] > read more

java.lang.UnsatisfiedLinkError: no dll in java.library.path Exception Java

Published on 2012-03-07 08:31:00

Java - Exception in thread "main" java.lang.UnsatisfiedLinkError: no dll in java.library.path"Exception in thread "main" java.lang.UnsatisfiedLinkError: no dll in java.library.path" is a frusttrating exception you will get if your application is using native library from java.lang.System.loadLibarray() method. I was writing  some Tibco Rendezvous Messaging code which uses some windows specific dll and I got "java.lang.UnsatisfiedLinkError: no *.dll in java.library.path". here we will see real c [..] > read more

How to read Properties File in Java – XML and Text Example Tutorial

Published on 2012-03-06 07:16:00

Reading and writing properties file in Java is little different than reading or writing text file in Java or  reading xml files in Java using xml parsers like DOM because Java provides special provision to properties file. For those who are not familiar with Properties file in java, It is used to represent configuration values like JDBC connectivity parameter or user preferences settings and has been a primary source of injecting configuration on Java application.  Properties file in Java i [..] > read more

How to add or list certificates from keystore or trustStore in Java - Keytool Example

Published on 2012-03-05 06:59:00

How to add certificates on keystore in Java is primary questions when you start working on SSL connection and simple answer is keytool utility in Java is used to add or list Certificates into keystore. SSL is industry standard for secure communication between two parties e.g. client and server. SSL offers two benefits, it encrypts data transferred between client and server to make it hard for someone to access and understand in between and SSL also verify identity of two parties in communication [..] > read more

10 Object Oriented Design principles Java programmer should know

Published on 2012-03-03 23:00:00

Object Oriented Design Principles are core of OOPS programming but I have seen most of Java programmer chasing design patterns like Singleton pattern , Decorator pattern or Observer pattern but not putting enough attention on Object oriented analysis and design or following these design principles. I have regularly seen Java programmers and developers of various experience level who either doesn't heard about these OOPS and SOLID design principle or simply doesn't know what benefits a pa [..] > read more

java.lang.NoSuchMethodError: main Exception in thread "main"

Published on 2012-03-02 21:41:00

How to solve java.lang.NoSuchMethodError: main Exception in thread "main"java.lang.NoSucMethodError comes when Java code tries to call a method which is not existed on a class, this could be either static or non static method. most common manifestation of java.lang.NoSuchMethodError is running a class which doesn't have main method in Java. In this article we will see what is "java.lang.NoSuchMethodError: main Exception in thread "main"" , Why does java.lang.NoSuchMethodError comes and how t [..] > read more

How to create and execute JAR file in Java – Command line Eclipse Netbeans

Published on 2012-03-02 21:08:00

Creating JAR file in java from command prompt is always been little tricky for many of us even if IDE like Netbeans and Eclipse provide support to export java program as JAR file simply because we don’t create jar often and not familiar with manifest file or jar command as whole. JAR file in Java is a kind of zip file which holds all contents of a Java application including Class files, resources such as images, sound files and optional Manifest file. JAR stands for Java Archive and provides a [..] > read more

How to format Decimal Number in Java - DecimalFormat Example

Published on 2012-03-01 08:58:00

We often need to format decimal numbers in Java like formatting numbers upto 2 decimal places or 3 decimal places or we want to introduce leading zeros in front of numbers. Thankfully Java programming language provides many different ways to format numbers in Java like either using Math.round() or setScale() from BigDecimal but caveat is that they also do rounding of numbers i.e. 1.6 will be rounded on 2.0 if we use Match.round(). If we are just interested in formatting decimal numbers upto n de [..] > read more

Java Mistake 1 - Using float and double for monetary or financial calculation

Published on 2012-02-29 07:41:00

Java is considered very safe programming language compared to C and C++ as it doesn't have free() and malloc() to directly do memory allocation and deallocation, You don't need to worry of array overrun in Java as they are bounded and there is pointer arithmetic in Java. Still there are some sharp edges in Java programming language which you need to be aware of while writing enterprise application. Many of us make subtle mistake in Java which looks correct in first place but turn out to [..] > read more

How to convert Char to String in Java with Example

Published on 2012-02-26 08:25:00

There are multiple ways to convert char to String in Java. In fact String is made of Character array in Java, which can be retrieved by calling String.toCharArray() method. Char is 16 bit or 2 byte unsigned data type in java mainly used to store characters. You can convert a single character into String for any purpose in Java by more than one ways. I thought about this article while writing how to convert Integer to String in Java but t it took little longer to get this post completed. In this [..] > read more

How to check or detect duplicate elements in Array in Java

Published on 2012-02-25 21:19:00

Detecting duplicate elements in Java array is another programming interview question I like. There could be lot of way you can check if your array contains duplicate elements or not and sometime you discover a unique way of checking duplicates by asking this question on Java interview. Beauty of this question is that it has endless number of follow-up question so if interviewee get through this question you can ask to him about time complexity and space or to improve his algorithm to make i [..] > read more

How to solve java.util.NoSuchElementException in Java

Published on 2012-02-25 01:34:00

How to fix java.util.NoSuchElementException in Javajava.util.NoSuchElementException is a RuntimeException which can be thrown by different classes in Java like Iterator, Enumerator, Scanner or StringTokenizer. All of those classes has method to fetch next element or next tokens if underlying data-structure doesn't have any element Java throws "java.util.NoSuchElementException". Most common example of this iterating over hashmap without checking if there is any element or not and that's w [..] > read more

How to set JAVA_HOME environment in Linux, Unix and Windows

Published on 2012-02-21 23:34:00

JAVA_HOME is a system environment variable which represent JDK installation directory. When you install JDK in your machine (windows, Linux or unix) it creates a home directory and puts all its binary (bin), library(lib) and other tools. In order to compile java program "javac" tool should be in your PATH and in order to get that in PATHwe use JAVA_HOME environment variable. Many tools like ANT and web servers like tomcat use JAVA_HOME to find java binaries. In this article we will see how to se [..] > read more

What is Race Condition in multithreading – 2 Examples in Java

Published on 2012-02-21 23:08:00

Race condition in Java is a type of concurrency bug or issue which is introduced in your program because  parallel execution of your program by multiple threads at same time, Since Java is a multi-threaded programming language hence risk of Race condition is higher in Java which demands clear understanding of what causes a race condition and how to avoid that. Anyway Race conditions are just one of hazards or risk presented by  use of multi-threading in Java just like deadlock in Java. Race co [..] > read more

JSTL set tag or <c:set> examples in JSP – Java J2EE Tutorial

Published on 2012-02-21 19:30:00

JSTL set tag or also called as JSTL Core tag library is a good replacement of jsp action which lacks lot of functionality and only allow you to set bean property. you can not set Map's key value or create a scoped variable by using . jstl tag allows you to do all the stuff related to setting or creating variables or attributes. by using JSTL tag you can : Read more » Java, Unix, Tibco RV and FIX Protocol Tutorial > read more

Difference between throw and throws in Exception handling - Java Example

Published on 2012-02-21 08:08:00

Difference between throw and throws keyword on Exception handling in Java is a popular core java interview question. Exception handling being an important part of Java programming language, complete knowledge of all keywords related to exception handling e.g. try, catch, finally, throw and throws is important. Main difference between throw and throws is in there usage and functionality. where throws is used in method signature to declare Exception possibly thrown by any method, throw is actually [..] > read more

Difference between LinkedList vs ArrayList in Java

Published on 2012-02-18 20:44:00

LinkedList and ArrayList both implement List Interface but how they work internally is where the differences lies. Main difference between ArrayList and LinkedList is that ArrayList is implemented using re sizable array while LinkedList is implemented using doubly LinkedList. ArrayList is more popular among Java programmer than LinkedList as there are few scenarios on which LinkedList is a suitable collection than ArrayList. In this article we will see some differences between LinkedList and Arr [..] > read more

How to encode decode String in Java base64 Encoding

Published on 2012-02-17 08:38:00

Encoding and Decoding of String in Java using base64 is extremely easy if you are using apache commons code opensource library. it provides convenient static utility method Base64.encodeBase64(byte[]) and Base64.decodeBase64(byte []) for converting binary data into base64 encoded binary Stream and than decoding back from encoded data in base64 encoding mechanism. Many times we need to encode sensitive data be it binary String  format transferring over socket or transferring or storing data in x [..] > read more

Producer Consumer Design Pattern with Blocking Queue Example in Java

Published on 2012-02-16 07:44:00

Producer Consumer Design pattern is a classic concurrency or threading pattern which reduces coupling betweenProducer and Consumer by separating Identification of work with Execution of Work. In producer consumer design pattern a shared queue is used to control the flow and this separation allows you to code producer and consumer separately. It also addresses the issue of different timing require to produce item or consuming item. by using producer consumer pattern both Producer and Consumer Thr [..] > read more

Why non-static variable cannot be referenced from a static context?

Published on 2012-02-15 06:56:00

"non-static variable cannot be referenced from a static context" is biggest nemesis of some one who has just started programming and that too in Java. Since main method in java is most popular method among all beginners andthey try to put program code there they face "non-static variable cannot be referenced from a static context" compiler error when they  try to access a non static member variable inside main in Java which is static. if you want to knowwhy main is declared static in Java see t [..] > read more

fail-safe vs fail-fast Iterator in Java

Published on 2012-02-11 01:01:00

Difference between fail-safe and fail-fast Iterator is becoming favorite core java interview questions day by day, reasonit touches concurrency a bit and interviewee can go deep on it to ask how fail-safe or fail-fast behavior is implemented.In this article article we will see what is fail-safe and fail fast iterators in java and differences between fail-fast and fail-safe iterators . Concept of fail-safe iterator are relatively new in Java and first introduced with Concurrent Collections in Jav [..] > read more

How to fix java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

Published on 2012-02-08 08:39:00

java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory  or "Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory" exception comes when you don't apache commons-logging-1.1.1.jar in your Classpath. I have faced this exception many times while using open source framework like Struts, Spring and Displaytag which uses commons-logging framework for logging. commons-logging is not an actual java logging framework but provides a wrapper [..] > read more

What is blocking methods in Java and how do deal with it?

Published on 2012-02-06 08:20:00

Blocking methods in Java are those method which block the executing thread until there operation finished. Famous example of blocking method is InputStream read() method which blocks until all data from InputStream has been readcompletely. Correct understanding of blocking methods are required if you are serious towards Java programming speciallyin early days because if not used carefully blocking method can freeze GUIs, hung your program and become non responsive for longer duration of time. In [..] > read more

Why wait, notify and notifyAll is defined in Object Class and not on Thread class in Java

Published on 2012-02-04 23:59:00

Why wait, notify and notifyAll is declared in Object Class instead of Thread is famous core java interview question which is asked during all levels of Java interview ranging from 2 years, 4years to quite senior level position on java development. Beauty of this question is that it reflect what does interviewee knows about wait notify mechanism, how does it sees whole wait and notify feature and whether his understanding is not shallow on this topic. Like Why Multiple inheritance is not supporte [..] > read more

3 Example to Compare two Dates in Java

Published on 2012-02-01 19:48:00

comparing dates in Java is common need for Java programmer, now and then we need to compare two dates to check whether two dates are equals, less than or greater than each other, some time we also needs to check if one dates comes in between two dates. Java provides multiple ways to compare two Dates in Java which is capable of performing Date comparison and letting you know whether two dates are same, one date come before or after another date in Java. In last couple of article we have seen how [..] > read more

Difference between instance class and local variables in Java

Published on 2012-02-01 09:37:00

There are lot of differences between instance variable, class variable and local variable in Java and knowing them will help you to write correct and bug free Java programs. Java is full featured programming language and provides different kind of variables like static variable also called Class variable since it belongs to whole Class, non static also called instance variable and local variables which varies in scope and value. Thank god Java doesn't have any register variable or auto scope [..] > read more

How to reverse String in Java using Iteration and Recursion

Published on 2012-01-30 03:46:00

How to reverse string in java is popular core java interview question and asked on all levels from junior to senior java programming job. since Java has rich API most java programmer answer this question by using StringBuffer reverse() method which easily reverses an String in Java and its right way if you are programming in Java but most interview doesn't stop there and they ask interviewee to reverse String in Java without using StringBuffer or they will ask you to write an iterative rever [..] > read more

How to resolve java.lang.UnsupportedClassVersionError with example

Published on 2011-07-01 23:13:00

How to resolve UnsupportedClassVersionError in Javajava.lang.UnsupportedClassVersionError is a quite common error after NoClassDefFoundError or ClassNotFoundException they all seems to related to class files but they all are different and there > read more

List of special bash parameter used in Unix or Linux script

Published on 2011-06-25 23:28:00

Meaning of bash parameter used in Unix scriptMany of us use bash script for doing housekeeping and other stuff but occasionally and not much aware of special bash parameters. When I was new to bash shell and Linux and looking on some already written > read more

3 example of converting array to arraylist and arraylist to array in java

Published on 2011-06-23 08:23:00

How to change from array to arraylist and arraylist to array in javaHave you encounter any situation where you quickly wanted to covert your array to arraylist or arraylist to array? I have faced many such situations which motivate me to write these > read more

10 example of using Vim or VI editor in UNIX

Published on 2011-06-20 22:49:00

Vim or VI editor tutorial in UNIX VI Editor is like notepad in UNIX but it’s extremely powerful and have sophisticated feature to work as complete IDE. No matter which version of UNIX you are working or which flavor you are using you always find ei > read more

3 ways to resolve NoClassDefFoundError in Java

Published on 2011-06-19 06:22:00

What is Exception in thread "main" java.lang.NoClassDefFoundError?I know how frustrating is to see Exception in thread "main" java.lang.NoClassDefFoundError Which is a manifestation of NoClassDefFoundError in Java , I have seen it couple > read more

How to use Comparator and Comparable in Java? With example

Published on 2011-06-18 01:43:00

Comparator and Comparable in Java ExamplesWhat is Difference between Comparator and Comparable in Java question was asked in a Test paper for one of big Investment bank first round of interview. It was not that straight forward but it was related to > read more

10 examples of grep command in UNIX and Linux

Published on 2011-06-12 02:04:00

10 examples of grep command in UNIX and Linux"grep" one of the most frequently used UNIX command stands for "Global Regular Expression Print". This grep command tutorial is not about theory of UNIX grep but to practical use of grep in UNIX and here I > read more

Top 30 Programming questions asked in Interview

Published on 2011-06-10 04:20:00

Top 30 Programming interview questionsProgramming questions are integral part of any java or C++ programmer or software analyst interview. No matter on which language you have expertise it’s expected that you are familiar with fundamental of progra > read more

Tibco tutorial : Reliability Parameter

Published on 2011-06-08 10:42:00

This is one of the important statup parameter we provide to rvd and incorrect setting up of this parameter can screw up things in big way. What is Reliability parameter of tibco? Message expiration depends on reliability parameter, the less the rel > read more

How Volatile in Java works ? Example of volatile keyword in Java

Published on 2011-06-03 23:03:00

How Volatile keyword works in JavaVolatile keyword in Java is used as an indicator to Thread that do not cache value of this variable and always read it from main memory. So if you want to share any variable in which operations read and write is atom > read more

An Example of using ArrayList in Java 1.5 with generics

Published on 2011-05-26 06:07:00

How to use ArrayList in java5 with GenericsArrayList in Java is most frequently used collection class after HashMap in Java. Java ArrayList represents an automatic resizable array and used in place of array. Since we can not modify size of an array a > read more

Why wait (), notify () and notifyAll () must be called from synchronized block or method in Java

Published on 2011-05-21 01:02:00

Why wait (), notify () and notifyAll () must be called from synchronized block or method in JavaMost of Java developer knows that wait() ,notify() and notifyAll() method of object class must have to be called inside synchronized method or synchronize > read more

Top 20 UNIX command Interview Questions asked in Investment Banks

Published on 2011-05-14 05:46:00

Top 20 UNIX command Interview Questions AnswersUNIX or Linux operating system has become default Server operating system and for whichever programming job you give interview you find some UNIX command interview questions there. These UNIX command int > read more

10 points about Java Heap Space or Java Heap Memory

Published on 2011-05-06 21:07:00

10 Points about Heap in JavaWhen I started java programming I didn't know what is java heap or what is heap space in Java, I was even not aware of where does object in Java gets created, it’s when I started doing professional programming I came acr > read more

Tibco Tutorials for beginners

Published on 2011-05-05 07:54:00

This Tibco Tutorial is collection of all my previous Tibco rendezvous and Tibco EMS tutorials. I have written this compilation post to provide all tibco tutorials at one place for easy navigation and access. Anyone who is started working on Tibco on > read more

Top 10 tips on logging in Java

Published on 2011-05-02 03:30:00

Java logging or logging in java is as much an art as science. knowing write tools and API for java logging is definitely science part but choosing format of java logs , format of messages, what to log in java , which logging level to use for which ki > read more

How Synchronization works in Java ?

Published on 2011-04-27 04:32:00

In this Java synchronization tutorial we will see what is meaning of Synchronization in Java, Why do we need Synchronization in java, what is java synchronized keyword, example of using java synchronized method and blocks and important points about s > read more

Difference between ConcurrentHashMap and Collections.synchronizedMap and Hashtable in Java

Published on 2011-04-24 10:38:00

Collections classes are heart of java API though I feel using them judiciously is an art. Its my personal experience where I have improved performance by using ArrayList where legacy codes are unnecessarily used Vector etc. JDK 1.5 introduces some > read more

Symbolic link or symlink in Unix Linux

Published on 2011-04-22 00:11:00

Symbolic links or symlinks are the heart of UNIX commands in my opinion. Symlinks gives you so much power and flexibility that you can maintain things quite easily. Whenever I do scripting or write any UNIX script I always write for symlinks rather t > read more

FIX Protocol Tutorial for beginners

Published on 2011-04-21 07:53:00

I have been writing FIX Protocol Tutorial from last few months and today I thought about doing a revision on all those FIX Protocol Tutorial. It’s very easy to read and forget about anything you have learn so periodic revision is very important and > read more

Top 10 Java Serialization Interview questions

Published on 2011-04-16 04:05:00

Java Serialization is one of important concept but it’s been rarely used as persistence solution and developer mostly overlooked java serialization API. As per my experience Java Serialization is quite an important topic in any java interview > read more

UNIX commands tutorial and tips for beginners.

Published on 2011-04-15 09:22:00

UNIX commands tutorial and tips for beginners.Hi, this is a kind of revision post where I would like share some of my earlier posted UNIX commands tutorial. Purpose of this post is to put together all UNIX commands tutorial in one place for easy acce > read more

How Garbage Collection works in Java

Published on 2011-04-11 23:04:00

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

Replaying messages in FIX protocol

Published on 2011-04-09 00:41:00

Replaying messages in FIX protocol In FIX Protocol two FIX engines communicate with each other using FIX messages and every FIX messages is assign with unique sequence number denoted by tag 34. Apparently every FIX engine has two sequence numbers Inc > read more

Top 20 Core Java Interview questions asked in Invesment Bank

Published on 2011-04-07 10:09:00

Top 20 Core Java Interview questions in Finance domain This is a new series of sharing core Java interview question on Finance domain and mostly on Big Investment bank. Anybody who is preparing for any Java developer Interview on any Investment bank > read more

Understanding DATALOSS Advisory in Tibco Rendezvous or Tibco RV

Published on 2011-04-01 23:21:00

Understanding DATALOSS Advisory in Tibco Rendezvous While working with TIBCO rendezvous you guys must have been faced problem of DATALOSS and might be aware of its severe consequences and in worst case how it can cause TIBCO Storm (A situation where > read more

10 tips on working fast in UNIX

Published on 2011-03-29 09:51:00

10 tips for working fast in UNIX Have you ever amazed to see someone working very fast in UNIX, firing commands and doing things in mille seconds? Yes I have seen and I have always inspired to learn from those gems of guys. This article or tutorial o > read more

10 examples of using find command in UNIX

Published on 2011-03-18 22:45:00

10 usage of find command in UNIX find is very versatile command in UNIX and I used it a lot in my day to day work. I believe having knowledge of find command in UNIX and understanding of its different usage will increase your productivity a lot in UN > read more

Design Patterns in the JDK - Java Code Geeks

Published on 2011-03-06 03:25:00

Design Patterns in the JDK - Java Code Geeks > read more

Googlers at Tech@State: Open Source Technology Conference - Google Open Source Blog

Published on 2011-03-06 03:07:00

Googlers at Tech@State: Open Source Technology Conference - Google Open Source Blog > read more

Top 20 FIX Protocol Interview Questions

Published on 2011-03-05 21:22:00

Top 20 FIX Protocol Interview Questions its' been a while since I shared FIX protocol interview questions. So here is the new set of top 20 FIX protocol interview questions. These are the question which is mostly asked in while interviewing any devel > read more

10 Interview questions on Singleton Pattern in Java

Published on 2011-03-03 06:28:00

10 Interview questions on Singleton Pattern in Java Singleton pattern is one of the most common patterns available and it’s also used heavily in Java. This is also one of my favorite interview question and has lots of interesting follow-up to digg > read more

How to setup remote debugging in eclipse

Published on 2011-02-25 22:24:00

How to setup remote debugging in eclipse Remote debugging is not a new concept and many of you are aware of this just for who don’t know what is remote debugging? It’s a way of debugging any process could be Java or C++ running on some other loca > read more

How to write equals method in JAVA

Published on 2011-02-23 21:43:00

How to write equals method in JAVA When I started JAVA i heard that JAVA is truly object oriented language and everything in JAVA is object, later I found that though its not completely true but yes most of things are in Java is represented via OOPS > read more

How to execute native shell commands from JAVA

Published on 2011-02-22 08:56:00

How to execute native shell commands from JAVA Though it’s not recommended but some time it’s become necessary to execute native operating system or shell command from JAVA, especially if you are doing some kind of reporting or monitoring stuff a > read more

FIX Protocol tutorials: Difference between Session Level Reject and Business message Reject

Published on 2011-02-18 21:14:00

FIX Protocol tutorials: Difference between Session Level Reject and Business message Reject In FIX protocol there are multiple ways of rejecting message some of them are using an Execution Report (MsgType=8) and ExecType=8 to reject a FIX message if > read more

Repeating groups in FIX Protocol

Published on 2011-02-17 06:53:00

FIX Protocol repeating group In this FIX protocol tutorial I am going to share my experience about FIX repeating block or group. This is fundamental concept of FIX protocol and used to carry repeating data. Correct understanding of various available > read more

Blogger Buzz: Subscribe to Comments - by email!

Published on 2011-02-15 08:29:00

Blogger Buzz: Subscribe to Comments - by email! > read more

TIBCO Ledger file in Certified messaging : TIBCO Tutorial

Published on 2011-02-14 06:34:00

TIBCO Ledger files in certified messaging This is in continuation to my previous article on TIBCO Certified messaging, in this TIBCO tutorial we will discuss about what is TIBCO ledger? What is process based ledger and what is file based ledger? &nbs > read more

How to implement Thread in JAVA

Published on 2011-02-12 07:32:00

How to implement Thread in JAVA In my opinion Thread is the most wonderful feature of JAVA and I remember when I started learning JAVA in one of programming class in India how important Thread was portrait and how much emphasis given on clear underst > read more

FIX Protocol Session or Admin messages tutorial

Published on 2011-02-05 23:26:00

FIX Protocol Session or Admin messages tutorial I have been working in FIX protocol for almost 5 years when I started working on FIX protocol I looked upon internet for some good tutorial which could supplement or complement lengthy FIX protocol spec > read more

Introduction to Tibco Hawk as Tibco Tutorial

Published on 2011-02-04 22:46:00

Tibco Hawk This is another short TIBCO tutorial from my TIBCO tutorial series. in this i am gonna discuss what is TIBCO hawk , Where do we use TIBCO hawk , What are components of TIBCO hawk , what benefit TIBCO hawk offers and how Tibco hawk wo > read more

How HashMap works in Java

Published on 2011-02-02 03:57:00

How HashMap works in Java How HashMap works in Java or sometime how get method work in HashMap is common interview questions now days. Almost everybody who worked in Java knows what hashMap is, where to use hashMap or difference between hashtable and > read more

test

Published on 2011-01-29 05:03:00

testing this to submit my blog feed automatically to digg. > read more

How Classpath work in Java ?

Published on 2011-01-28 21:35:00

CLASSPATH in JAVACLASSPATH is one of the most important concepts in java but I must say oftenly overlooked. This should be the first thing you should learn while writing java programs because without understand classpath you can't understand how java > read more

Difference between FIX 4.2 vs FIX 4.4 in FIX connectivity

Published on 2011-01-25 07:55:00

FIX 4.2 vs FIX 4.4 FIX protocol has evolved over time , its now more than a decade its started by Fidelity and Solomon Brothers. FIX connectivity is the most popular connectivity solution exists for trading whether its equities, futures, options or f > read more

Things to note down while writing your own FIX Engine on FIX protocol

Published on 2011-01-24 08:05:00

This is in continuation of my FIX protocol tutorial series , i am just sharing some of thoughts which are important to remember while writing FIX engine for FIX protocol , though there are couple of professional third party FIX engines are available > read more

Tibco RV Interview Question as part Tibco RV Tutorial series

Published on 2011-01-21 07:59:00

Hi Guys , in this part of my tibco rv tutorial series I am sharing some Tibco RV interview questions most oftenly asked in any tibco messagging interview. these are based on fundamental tibco concepts and also offers some new way of learning tibco rv > read more

Tibco tutorial : RVD (Rendezeous daemon) vs RVRD (Rendezeous Routing Daemon)

Published on 2011-01-14 22:39:00

RVRD (Randezeous Routing Daemon) are simply process owned by middleware/network teams which listens multicast traffic locally and transmit it to another RVRD counter part (another host) using TCP. this remote host than re multicast this traffic to th > read more

Tibco tutorial : Http Interface of Tibco RV

Published on 2011-01-14 22:38:00

This is another post of my tibco tutorial series , if you want to read more about tibco rv or tibco ems please read there. in this post I am sharing you great tool to solve tibco rv related problems and a great interface to anaylze your Tibco RVD act > read more

Basics of FIX protcol and FIX Engine

Published on 2011-01-13 08:57:00

FIX protocol is Industry standard protocol for electronic trading , with evolution with computer technology Trading also getting Electronic and now most of the exchanges in the world are fully electronic and concept of trading floor is taken over by > read more

FIX protocol tutorial : Fix Session is not connecting how to diagnose it ?

Published on 2011-01-11 09:22:00

In this blog post of FIX protocol tutorial series I would like to share my experience with connectivity issues around Fix Engines. to exchange message or say to trade electronically clients connect to broker using FIX protocol and for that they use F > read more

Tibco tutorial : Tibrv Errors and Exceptions

Published on 2011-01-08 22:26:00

While working with tibco rv during many years I found that tibco errors are mysteriously difficult to diagnose for a newcomer and minor difference between syntax and semantics along with network specifics lead some strange error. here I am putting mo > read more

Tibco tutorial : Difference between Tibco EMS and Tibco RV

Published on 2011-01-01 20:47:00

Both of them are product from Tibco and used extensively across global investment banks for front end to back end communication or server to server communication. though they have difference in the manner they have designed and the specification they > read more

Happy New Year 2011

Published on 2010-12-31 01:39:00

Wishing you all very happy new year Welcome 2011 . May this year brings happiness , accomplishment and cheers to all. > read more

Fix Protocol Interview Questions

Published on 2010-12-21 06:40:00

Some more Fix protocol interview question , I will put answer along when I'll get some time for now just questions :) Now I have updated it with answer , Please let me know if you have any doubt , or you have other questions , you can also co > read more

Common issue on Fix Connections

Published on 2010-12-17 21:46:00

Hi guys , in this post I would like share my experience with Fix Connections which is essential to setup connectivity for trading purposes. Fix Connections used in both Client Connectivity and Exchange connectivity space ( in case exchange supports F > read more



© 2006-2012 OnToplist.com, All Rights Reserved