Monday, April 28, 2008
Tech Bangalore Subscribe via E-mail: Free Live Score Updates on Mobile!
http://in.wap.yahoo.com,Click on Yahoo Cricket > Scorecard to view live score.
for activating free gprs rajasthan wait for new posts
Working proxy(ies) for Orkut, Myspace, Facebook, etc
- http://www.blackdile.com/
- www.jumboproxy.net
- www.orkuch.com
- www.orkutpass.com
- www.orkut.pk
- http://pmoder.info/
- http://smex.in/
- http://bowsnap.com/
- http://pagemod.com/
- http://backfox.com
- http://atunnel.com
- http://calculatepie.com
- http://bravebadger.com
- http://kproxy.com
- http://www.stupidcensorship.com
- http://www.vmathpie.com
- http://www.ipfaker.com
- http://www.orkutproxy.in/
- http://62.193.235.46
- http://www.ipfaker.com
- http://www.backfox.com
- http://www.newbackdoor.com
- http://www.proxut.com
- https://www.fancysportscar.com/
- https://www.goldpuddle.com/
- https://www.tirephone.com/
- https://www.tirephone.com/
- https://www.jellyshell.com/
- https://www.smokeflower.com/
- https://www.spiceflame.com/
- https://www.headcross.com/
- https://www.fancysportscar.com/
- https://www.goldpuddle.com/
- https://www.smokeflower.com/
- https://www.frogtunnel.com/
- https://www.turtlejar.com/
- https://www.jokebottle.com
- https://www.hairchip.com
- https://spacepiano.com
- https://cakebird.com/
- https://iceknock.com/
- https://junkblender.com/
- https://cheeseglobe.com
- https://kitebroth.com
- https://www.technotapes.com/
Tuesday, April 22, 2008
Interface
Humans and Parrots as subclasses of a Whistler class, rather they would most likely be subclasses of an Animal class (likely with intermediate classes), but would both implement the Whistler interface. Another use of interfaces is being able to use an object without knowing its type of class, but rather only that it implements a certain interface. For instance, if one were annoyed by a whistling noise, one may not know whether it is a human or a parrot, all that could be determined is that a whistler is whistling. In a more practical example, a sorting algorithm may expect an object of type Comparable. Thus, it knows that the object's type can somehow be sorted, but it is irrelevant what the type of the object is. The call whistler.whistle() will call the implemented method whistle of object whistler no matter what class it has, provided it implements Whistler.
Abstract class
Abstract classes are classes that contain one or more abstract methods. An abstract method is a method that is declared, but contains no implementation. Abstract classes may not be instantiated, and require subclasses to provide implementations for the abstract methods. Let's look at an example of an abstract class, and an abstract method.
Suppose we were modeling the behavior of animals, by creating a class hierachy that started with a base class called Animal. Animals are capable of doing different things like flying, digging and walking, but there are some common operations as well like eating and sleeping. Some common operations are performed by all animals, but in a different way as well. When an operation is performed in a different way, it is a good candidate for an abstract method (forcing subclasses to provide a custom implementation). Let's look at a very primitive Animal base class, which defines an abstract method for making a sound (such as a dog barking, a cow mooing, or a pig oinking).
public abstract Animal
{
public void eat(Food food)
{
// do something with food....
}
public void sleep(int hours)
{
try
{
// 1000 milliseconds * 60 seconds * 60 minutes * hours
Thread.sleep ( 1000 * 60 * 60 * hours);
}
catch (InterruptedException ie) { /* ignore */ }
}
public abstract void makeNoise();
}
Note that the abstract keyword is used to denote both an abstract method, and an abstract class. Now, any animal that wants to be instantiated (like a dog or cow) must implement the makeNoise method - otherwise it is impossible to create an instance of that class. Let's look at a Dog and Cow subclass that extends the Animal class.
public Dog extends Animal
{
public void makeNoise() { System.out.println ("Bark! Bark!"); }
}
public Cow extends Animal
{
public void makeNoise() { System.out.println ("Moo! Moo!"); }
}
Now you may be wondering why not declare an abstract class as an interface, and have the Dog and Cow implement the interface. Sure you could - but you'd also need to implement the eat and sleep methods. By using abstract classes, you can inherit the implementation of other (non-abstract) methods. You can't do that with interfaces - an interface cannot provide any method implementations.
Difference Between Applet and Application
In simple terms, an applet runs under the control of a browser, whereas an application runs stand-alone, with the support of a virtual machine. As such, an applet is subjected to more stringent security restrictions in terms of file and network access, whereas an application can have free reign over these resources.
Applets are great for creating dynamic and interactive web applications, but the true power of Java lies in writing full blown applications. With the limitation of disk and network access, it would be difficult to write commercial applications (though through the user of server based file systems, not impossible). However, a Java application has full network and local file system access, and its potential is limited only by the creativity of its developers.
Feature Of java
- Here we list the basic features that make Java a powerful and popular programming language:
- Platform Independence
- The Write-Once-Run-Anywhere ideal has not been achieved (tuning for different platforms usually required), but closer than with other languages.
- Object Oriented
- Object oriented throughout - no coding outside of class definitions, including main().
- An extensive class library available in the core language packages.
- Compiler/Interpreter Combo
- Code is compiled to bytecodes that are interpreted by a Java virtual machines (JVM) .
- This provides portability to any machine for which a virtual machine has been written.
- The two steps of compilation and interpretation allow for extensive code checking and improved security.
- Robust
- Exception handling built-in, strong type checking (that is, all data must be declared an explicit type), local variables must be initialized.
- Exception handling built-in, strong type checking (that is, all data must be declared an explicit type), local variables must be initialized.
- Several dangerous features of C & C++ eliminated:
- No memory pointers
- No preprocessor
- Array index limit checking
- Automatic Memory Management
- Automatic garbage collection - memory management handled by JVM.
- Automatic garbage collection - memory management handled by JVM.
- Security
- No memory pointers
- Programs runs inside the virtual machine sandbox.
- Array index limit checking
- Code pathologies reduced by
- bytecode verifier - checks classes after loading
- class loader - confines objects to unique namespaces. Prevents loading a hacked "java.lang.SecurityManager" class, for example.
- security manager - determines what resources a class can access such as reading and writing to the local disk.
- Dynamic Binding
- The linking of data and methods to where they are located, is done at run-time.
- New classes can be loaded while a program is running. Linking is done on the fly.
- Even if libraries are recompiled, there is no need to recompile code that uses classes in those libraries.
This differs from C++, which uses static binding. This can result in fragile classes for cases where linked code is changed and memory pointers then point to the wrong addresses.
- Good Performance
- Interpretation of bytecodes slowed performance in early versions, but advanced virtual machines with adaptive and just-in-time compilation and other techniques now typically provide performance up to 50% to 100% the speed of C++ programs.
- Interpretation of bytecodes slowed performance in early versions, but advanced virtual machines with adaptive and just-in-time compilation and other techniques now typically provide performance up to 50% to 100% the speed of C++ programs.
- Threading
- Lightweight processes, called threads, can easily be spun off to perform multiprocessing.
- Can take advantage of multiprocessors where available
- Great for multimedia displays.
- Built-in Networking
- Java was designed with networking in mind and comes with many classes to develop sophisticated Internet communications.
Features such as eliminating memory pointers and by checking array limits greatly help to remove program bugs. The garbage collector relieves programmers of the big job of memory management. These and the other features can lead to a big speedup in program development compared to C/C++ programming.




