Java Cracker

-by Kausik Jana

String in switch statements with example

We know switch statement works with primitive types(int, short, byte) or enum constants. Java 7 introduced switch case with “String“.

Continue reading

Importance of hashCode() and equals() methods

While we are working with objects in collection framework, we need to consider the followings:

  • Set doesn’t allow duplicate value.
  • Map uses the key object which can’t duplicate

Continue reading

To restrict a java class from creating multiple objects

To restrict a java class from creating multiple objects

We can restrict our java class for creating specified number of objects of it and it’s very easy. Before going to this topic I want to share some knowledge on singleton class.

Continue reading

Create a JMS client using CCDT URL

Create a JMS client using CCDT URL

In my on job learning I have leant and written a java code to establish a connectivity using CCDT(Client Channel Definition Table) url. I just share my real time experience with you. It may help you to resolve your problems.

Continue reading

Convert image to String and String to image

Convert image to String and String to image

I am working in a project where I implemented a module which can convert an image to string and vice versa. So I just thought to post it here.

Continue reading

Create JMS Client for IBM MQ with example

Create JMS Client for IBM MQ with example

Before going to the example let me tell you about JMS. JMS stands for Java Message Service API that allows java application to communicate with any messaging implementation by sending, and consuming messages. Also you can create a message using this API.
I am giving an example of JMS client for IBM MQ. You can use JMS API provided by Sun or IBM MQ API provided by IBM. In this example, I am using IBM MQ API and IBM WebSphere MQ Series.
Example : SimpleJMSClient.java

Continue reading

« Older posts

© 2014 Java Cracker

Proudly Powered by Wordpress