Wednesday 6 November 2013

PLAY PIANO WHENEVER AND WHEREVER YOU WANT

AAH NICE TO SAY YOU THAT NO NEED TO CARRY YOUR HEAVY PIANO EVERYWHERE..
IF YOU WANT TO PLAY PIANO AT YOUR CANTEEN TO CELEBRATE FRIENDS BIRTHDAY PARTY..I HOPE THIS WOULD BE THE BEST CHOICE FOR YOU..

JUST GO THROUGH IT AND ENJOY
1) CLICK ON THIS LINK PLAY PIANO
2) WAIT FOR SOME TIME TO LOAD
3) BY PRESSING YOUR KEYS OF YOUR KEYBOARD PLAY YOUR PIANO OF YOUR CHOICE..

HAVE FUN AND ENJOY.....

INHERITANCE IN JAVA

MULTIPLE INHERITANCE IS NOT ALLOWED. THEREFORE JAVA USES INTERFACE TO SUPPORT MULTIPLE INHERITANCE...
LETS SOLVE THIS QUERRY BY A PROGRAM..

PROGRAM:-
class X
{
void show()
{
System.out.println("Hello,Java I am inherited");
}
}
class Y extends X
{
}
class Demo
{
public static void main(String args[])
{
Y a=new Y();
a.show();
}
}

Output:-
Hello,Java I am inherited.

Note :- X is a super class and Y is a child class and extends is a keyword.


  • Super Keyword :- used inside the child class to access the super class instance variable.
          There is some restrictions which I have mentioned below..
      Restriction:- The first statement inside the child class constructor must be super, otherwise it will give a compile time error.

Program:-
class X
{
voud show()
{
System.out.println("Hello");
}
}
class Y extends X
{
}
Class Z extends Y
{
z()
{
super.show();
}
}
Public class Demo extends Z
{
public static void main(String args[])
{
Z obj=new z();
}
}

Output:-
Hello

Monday 4 November 2013

DONT DEPEND ON TECHNOLOGY FULLY

The topic has made me to write from experience that i got in my daily use..After reading this you will tell me duffer..But i am ready to accept this title..But it is true for every single people on this planet..We rely mostly on the technology rather then using our mind or our common sense at a particular situation..As usual i am in support of the technology..But depending totally on it can be dangerous or will make us unsucessfull in that work..
So here is the real story that gives only one conclusion that we should use technology but we should also use our common sense at the same time
The fact begins when i have to catch a train from Patna station to go to my home..Waiting at the station i searched for the trainenquiry website on my phone to find out the train from patna to my home..Then i querried abou the train to find the running status of the train..waiting at platform no. 4 for my train i searched again and again and it showed the same result evertime that train has not started yet..I was worried as time of train was passing..when it was late enough and still it was showing on my mobile that train has not started yet..I decided to ask from the enquiry counter..And you won't beleive what they told to me..They told me that train has just passed from patna station half n hour before..And still it was showing the same result on my phone..That time i decided to use my common sense with the technology world..Hope you laughed at me and in the period of laughing you too have realised that we should not fully depend on technology..God has given us mind to use..And it is well told that humans are those who learn from others fault..

Sunday 3 November 2013

ARRAY

I don't think that i have to say what is Array as all of you have read it many times..I am staright away here with the program..So read it guys...

PROGRAM:-
public class Demo
{
public static void main(String args[])
{
int []mark=new int[3];
mark[0]=1;
mark[1]=2;
mark[2]=3;
System.out.println(mark[1]);
}
}

Output:-
2

Note:- The word new written in blue color in above program is used to create Array in a java program..
Hope you got it...