Java Program to find the IP address of the Machine

Wednesday, April 17th, 2013  »  Posted By  »  Total 1 Comment

Here is a simple Java Program to find the IP address of the Machine. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16   import java.util.*; import java.lang.*; import java.net.*;   public class GetOwnIP { public static void main(String args[]) { try{ InetAddress ownIP=InetAddress.getLocalHost(); System.out.println("IP of my system […]

Java program that illustrates how run time polymorphism is achieved

Sunday, October 4th, 2009  »  Posted By  »  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  »  Total 3 Comments

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

Java program that displays the number of characters, lines and words in a text file

Friday, October 2nd, 2009  »  Posted By  »  Total 2 Comments

while((c=isr.read())!=-1)
{
chars++;
if(c==’\n’)
lines++;
if(c==’\t’ || c==’ ‘ || c==’\n’)
++words;
if(chars!=0)
++chars;
}

Java program using String Tokenizer class

Friday, October 2nd, 2009  »  Posted By  »  Total 2 Comments

Write a Java program that reads a line of integers and displays each integer and sum of all integers using String Tokenizer class

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

Free email signup

Email: