Java 6 Update 7 available- Includes Java VisualVM and VisualVM 1.0

Sun is announcing Java VisualVM, a new GUI-based tool for troubleshooting Java applications. Available as part of JavaSE 6 Update 7 (available today) VisualVM incorporates various technologies, including: jvmstat, Java Management Extensions (JMX), and the NetBeans profiler, in order to provide a unified easy-to-use visual diagnostic tool for both development and production environments. For more … Read more

First Attempt @ Servlets, JSP and Cookies

I have been doing Servlets and JSPs from quite some days and yeah they have been lots of interesting stuff in it, And this is my first attempt at Web Technologies. I would recommend beginners to use Head First Servlets and JSP book. It’s a superb book to read, one can enjoy reading and the concepts are taught in terms of process- like how they happen. Some time back i had recommended Head First Java. One can read the review here.

As it is the first time i am doing some thing in Servlets and Cookies, the below given example is a pretty simple one which explains the use of cookies in communication between client and server lasting more than one request.

Read more

Java and Python Compared

I have been posting lots of “Compared Stuff”. Its because being a Java programmer i would love to read why the new programming language i am interested in learning or have already learn’t is different from Java. And as i was going through Python for Java Programmers (Link) I found an interesting comparison between Java … Read more

Passing Variables into Methods- Java Passing Mechanism Explained

Every Programming Language has its own way of passing the variables into methods. There are basically two ways of passing variables- Pass by Reference and Pass By Value. The former deals with the passing of reference or pointer to particular variable and the latter involves passing a copy of the variable to the method. C supports both ways of passing and the Pass By Reference is supported b means of Pointers. Every Java Beginner ponders over “Is Java a Pass By Value?” or “Is it a Pass By reference?”  or “Both?”. Before answering the question i would like to throw light on Passing Object Reference variables and Passing primitive reference variables.

Object Reference Variables: These are the variables which refer to the object of the declared type or its subtype. Something like

Animal a = new Animal()

where  a is the reference variable

Passing Object Reference Variables:

When a object variable is passed into the method, only the copy of the Object reference is passed and not the Object itself. The bit pattern in the reference variable is copied into the method parameter. What is this bit pattern? This bit pattern is the address of the specific object in the memory (on the heap). In other words, both the caller and the called method will now have identical copies of the reference and thus both will refer to the same exact object on the heap.

Read more

Interested in Open Source Java Projects?

As i was going through Amit Kumar Saha’s blog at Blogspot, I found a post on “Participating in Open source Java Projects“. Actually sometime back i had asked Ashwin on what i can probably do using Java and he had mentioned trying out java.net . But this post has whole lot of resources for contributing to java Projects. A really detailed post, must read for Java programmers is what i say, especially those interested in Open Source Java Projects.

Read more

Initialization Blocks in Java

Apart from methods and constructors, Initialization Blocks are the third place in a Java Program where operations can be performed. Initialization Blocks come in two flavours:

  • Static Initialization Blocks: Runs first when the class is first loaded. Declared by using the keyword “Static”
  • Instance Initialization Blocks: Runs every time when the instance of the class is created.

Read more

Java vs.NET – Articles by Bruce Eckel

There are two articles by Bruce Eckel in which he has spoken in brief about C# / .NET and Java. These two are pretty old articles but i feel they are worth reading once, pretty small write ups. Bruce Eckel is the author of famous Thinking in sreis- Thinking in C++ and Thinking in Java. Article … Read more

C Programming VS. Java Programming

I wanted to know how C and Java differ from each other. So i just googled for “C Versus Java” . The first Link itself led me to an interesting Description. I thought of sharing it with my readers. Pretty good Comparision of C and Java. One can read the comparision here. PS: If anyone … Read more

@BOJUG Meet 2008.06

I had visualized in my mind that a meet would be like someone giving a talk standing on the podium and rest participants comfortably seated in the chairs facing the speaker with an AC running trying to put the listeners to sleep – its actually the combined effect of the AC and the speaker. One thing i would like to share here is my experiences at the Great Indian Developer Summit. I had a real tough time holding back my eyes from drooping especially after the lunch. The talks, the lunch, the AC, and the darkness would all put me to sleep. With all this notions I set out to attend the BOJUG meet. For all those who don’t know what BOJUG is I would throw a brief intro here: BOJUG stands for Bangalore Open Java Users Group. It organises meets every month inviting developers to give talks on various topics related to Java. Its an open forum where people can share ideas, discuss and to promote Java.

Read more

Shadowing Variables in Java Demystified

One of the meanings of the word “Shadow” in the Oxford Dictionary is “a weak or less good version”. Shadowing in Java is also something similar. One can shadow a variable in several ways. I would try to describe the one most comman ways which would trip most of us i.e. “Hiding an instance variable by shadowing it with a local Variable”. What exactly is Shadowing in Java? Shadowing is nothing but redeclaring a variable that’s already been declared somewhere else. The effect of Shadowing is to hide the previously declared variable in such a way that it may look as though you’re using the hidden variable, but you’re actually using the shadowing variable (The Code Snippet below will make it more clear). This most of the times happens by accident and causes hard-to-find bugs.

Read more