Can anyone walk me through the steps to connect remote queue in java
code?
Sure. Have a look at IBM WebSphere Developer Technical Journal: Running a standalone Java application on WebSphere MQ V6.0. Although this was written for MQ v6.0, the code still works on later versions of MQ. The article includes downloadable code and extensive explanations of how it works.
Or could you provide me any instruction/sample code that I can use as
reference?
As opposed to the code IBM provides? ;-) As Shashi notes in the comments, have a look in the <MQ install folder>\tools\jms\samples and <MQ install folder>\tools\wmqjava\samples folders if you are on Windows. If you are on *NIX then look under <MQ install folder>/samp.
Of course, these are not the only samples available. Roger over at Capitalware has amassed one of the largest (if not the largest) collections of source code samples and an index of 3rd party products for MQ anywhere. Within that vast trove, you want to check out the Java Applications category in the Downloads section.