Tuesday, September 22, 2009

ICC Mini World Cup 2009 Begins....

Eight teams,fifteen matches,eighty eight players,Fifteen days and One Trophy.Eight teams have been here In South Africa to bring the Trophy their Home.But this time we can't predict that which team goes to win the ICC World CHAMPIONS TROPHY for 09/10.

Aussies comes out to the field as the dependable world Champions..They were the world champions in 2007.and Mini world cup champions in 2007 as well.





Hosts ,Home side being No 1 world cricket team in ICC ODI rankings. and they are hoping that "This time is their chance.Nobody can carry out the Trophy away ".





SriLanka India and Pakistan , Representatives of Asia Srilanka being a runners up of the ICC world cup 2007.India come up with a strong batting line up. and Pakistan being a strong and capable of changing the match.



Kiwi es here in SA after a long tour in SriLanka and made it fine.
Here is the top 6 teams in ICC world ranking .







Including West indies and England . There responsibility to show colours to spectators. In Natwest series they got a unhappy experience with Australia.




West Indies won't play their full team.

Monday, September 21, 2009

Casting Objects

One Object reference can be type cast in to another object reference.That class can be to its own class type or to one of its super class or sub class typees or interface.


In Java we can do Object casting in two types.

# Up Casting
# Down Casting

Let's say we cast a reference along the class hierarchy in a direction from the root class towards the sub class.So this is kown as the Down Casting.

When we cast it towards the sub class to super class , It's known as Up Casting.
In this case we do not need to use class operater.

We will take a look at a Simple Example..

Ex A.
UpCasting

Class Animal{
}
Class Dog extends Animal{
}
Class DogTest{
public static void main(String[]args){

Dog dog=new Dog();
Animal animal=dog; //Up Casting.This is ok with no explicit cast.
Animal animal=(Animal) dog; //Up cast ok with explicit cast.

Ex : B

Down Casting

Class Animal{
}
Class Dog extends Animal{
}
Class DogTest{
public static void main(String[]args){

Animal animal =new Animal();
//Dog d=animal; //we cant write it like this .
Dog d=(Dog)animal;//now this is ok .But compiles it .but gives a run time error.
}

imp:- When we doing Down casting we can compile it. but when we run it it gives an error like this.

java.lang.ClassCastException.

Wednesday, September 16, 2009

Python : -" Hello World "

Befor you start learning PYTHON you will have to have python software. This software can be downloaded from follwing link:

http://wiki.python.org/moin/BeginnersGuide/Download.

you should download the relevent packege according to your operating system.

Install it .


now Let's how can we write out first programme.

1.
we can do it with using Phython shell.

click on START button then ALL PROGRAMS then PYTHON2.6 then select IDLE(python GUI).

white screen consol will be appeared .

type on there as follows;

When you type like that Hello World will be printed there ,itself.



print " Hello World"


Hello World


2.
we can do it using python command line.

click on START button then ALL PROGRAMS then PYTHON2.6 then select PYTHON(Command Line).

Then black colour consol will be appeared ;

you can type it as above example and or as follows.

print "Hello World " * 3


Hello World Hello World Hello World


rem : when you are multipling by 3 . there should be a gap either side of "*";

3.

you can try this out with the operating systems's consol application.
if it is Windows -MS Dos.
Ubuntu -Ubuntu Konsole.
Kubuntu -Kubuntu Konsole.

Befor you use that you need to configure the path .

path is like a specfic preticular place where python's file saved.you can make it as like Java path.

Then go to cmd prompt. And change to your "python 26" dirctory .

And Then type on the consol like python.look follows.

fisr appear as :-

c:\Python26>

then type "python"

c:\Python26> python

After that you can print what ever thing you want . same as we did in the above examples.

print"I am a technology Geek"


I am a technology Geek



4.We can do codings stuff using a text editor.
type on your editor as

print "Lahiru" * 3

then save it as .py extension..

like this lahiru.py

make a folder inside python26 folder and save it inside that.

let's say your folder name is PythonProjects.

Then go to the consol application and go your project sved place.
like this

c:\Python26\PythonProjects>_

go to above place and type the python an filename with the extension.as follows.

c:\Python26\PythonProjects>python lahiru.py

Then out put will be :


Lahiru Lahiru Lahiru



Imp:-

If you want to go out from the pythons Server to your friendly Editor use Ctrl+Z


Introduction for python

python is a powerful and clear object oriented programing language comparable to Perl,Ruby,Scheme, or Java.This supports many programming tasks like connecting to web servers, searching text with regular expressions, reading and modifying files.

*python supports object oriented programming with classes and multiple heritance.
*code can be grouped into modules packages.
*python supports catching exception ,resulting in cleaner error handling.
*data types-mixing incompatible types.[eg:-attempting to add a string and a number .
*python contains advanced programming features such as genaratoers and list comprehnsion.
*automatic memory management frees you from having to manually allocate and free memory in your code.
*Runs on many different computers and operating systems . ex : Macos/linux /windows memory

Wednesday, September 2, 2009

Re-Usability

This term allows programmers to same written and debugged existing class of data.Advantages are time saving and coding efficency.programmer can incooperate new features to that existing class.further developing and application and allowing user to achive increased performance.

Overloading

This is not the frist time i am going to write abt overloading..i have written function overloading under lable of c#


This is a one type of polimorphysm
It allows an object to have different meanings, depending on its context. When an exiting operator or function begins to operate on new data type, or class, it is understood to be overloaded.

Polimorphism

Polimorphism allows routines to use variables of different types at different times.polimorphism refers to a single function or multifunctioning operator performing in a different way

Encapsulation

Data Encapsulation combines data and functions in to classes.when using encapsulation you cant access directly to data(data is not accessed directly).only accessible through the functions.Encapsulation enables the important concept of data hiding possible.

Data Abstraction

Data abstraction increases the power of programming language by creating user defined data types.Data abstraction also represents the needed information without presenting the more details..

Inheritence

This is the process of forming a new class from an exsisting class or base class. THis base clas is known as the super class or parent class. that newly formed class is called derived class or child or subclass as well.Inheritence is supporting for reducing the overall codesize.This is a very importent concept in OOP

Classes

Specially ,classes are data types based on which objects are created.
objects which are having similer properties and methods are grouped together, when set a class.classes having set of individual objects.characteristics are represented as properties of the class .Using methods ,objects become function of the class.

EX:class is CAR

objects: suzuki,Honda,Yamaha...

this car object has its own model/year of manufacture/maximum speed/Engin power these are known as properties..

And associated actions objects function like start move stop methods of car class..

Objects

Object is the basic unit of object oriented programming.They are having a unique name.An object represents a preticular instance of a class.There can be morethan one instance of an object.Instance object can hold own relevent data.An object is collection of data members and associate member functions