Showing posts with label Java Learning. Show all posts
Showing posts with label Java Learning. Show all posts

Sunday, September 7, 2008 | | 0 comments

Why implementing runnable is better than extending thread?

We all know that there is two ways to implement threading in Java. And everyone say that implementing runnable is better than extending thread. Why is it so? Simple answer...A Java class can extend only one class( Hybrid or Hierarchical inheritance is not supported) but it can implement any number of interfaces. Thus if we extend Thread in a class which require to be an applet or form, it is not possible.
So always implement runnable.

Sunday, August 31, 2008 | | 0 comments

List of student projects in Java

I wasted the entire night. Did not do anything worth. Anyway browsed Internet and found some good Java resources.

One of them is here for you : A nice list of student projects in Java

And many people say eclipse is better than netbeans. Is it? Anyway I'm gonna stick to netbeans.

| | 0 comments

A CLI Java Network Application

Finally, I did make a simple Command Line Java network application to work. In fact, I just copied it from this "Creating simple Chat client" available at Internet. But I learned each and every line of code in it, the only thing I wanted.

Now I'm going to make it work in a GUI. As per now, I have succeeded partially. On way I learned theory of Sockets classes in Java which implements(not in the Java sense) it.

I will post my updates after completing it. Oh, almost forgot....I will be doing this project as a network application.

Saturday, August 30, 2008 | | 0 comments

Packages in Java

A package is a collection of classes. There are inbuilt packages and you can also build package of your own. In fact, whatever program you build belong to a package(It was a new information for me). If you do not manually specify a package name, it belong to a nameless package. It is recommended only for small test programs sor simple applications. All major works should use a package. We will do too!!!

You can learn more about packages here
Sun tutorial on Java PAckages

| | 0 comments

Set Path for Java in Windows Vista

Now, I wanted to set path for Java in Windows Vista to make it run at command prompt. I re-learned it from Sun Java site

Goto System->Advanced->Environment variables ->

Under system variables, modify the path option. Put a semi column (;) and add the path to your Java's bin directory (mine was C:\Program Files\Java\jdk1.6.0_03\bin) to it.

You are done.