Java program that illustrates how run time polymorphism is achieved

Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 0 Comment

figure f=new figure(45,6);
rectangle r=new rectangle(10,30);
triangle t=new triangle(10,20);
figure a;
a=f;
System.out.println(a.area());

Java program for implentation of consumer problem using inter thread communication

Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 1 Comment

Write a Java program that correctly implements producer consumer problem using the concept of inter thread communication

Java program for creating multiple threads

Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 0 Comment

NewThread(String threadname)
{
name=threadname;
t=new Thread(this,name);
System.out.println(“New Thread:”+t);
t.start();
}

Java program that converts infix expression into postfix form

Sunday, October 4th, 2009  »  Posted By Ranjith  »  Total 1 Comment

Enter input string
a+b*c
Input String:a+b*c
Output String:
abc*+

Java program that implements stack ADT

Friday, October 2nd, 2009  »  Posted By Ranjith  »  Total 0 Comment

public stack(int s)
{
size=s>0?s:10;
top=-1;
elements=(E[])new Object[size];
}

Question and Answer
C/C++ Unix & Linux Wordpress
Source codes
C C++ Java

Free email signup