Java program to display the information’s of the file

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

Write a Java program that reads on file name from the user then displays information about whether the file exists,whether the file is readable,whether the file is writable,the type of the file and the length of the file in bytes

Java program using String Tokenizer class

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

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

Java Program to multiply two matrices

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

System.out.println(“Enter the first matrix:”);
Scanner input=new Scanner(System.in);
for(int i=0;i<3;i++)
for(int j=0;j<3;j++)
a[i][j]=input.nextInt();

Java program to sort a given list of names in ascending order

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

for(int j=i+1;j {
if(names[i].compareTo(names[j])<0)
{
temp=names[i];
names[i]=names[j];
names[j]=temp;
}
}

Java program that checks whether the given string is palindrome or not

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

StringBuffer s1=new StringBuffer(args[0]);
StringBuffer s2=new StringBuffer(s1);
s1.reverse();
System.out.println(“Given String is:”+s2);
System.out.println(“Reverse String is”+s1);

Java program to print the prime numbers

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

Write a Java program that prompts the user for an integer and then prints out all prime numbers up to that integer.

Java program to print Fibonacci sequence

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

Write a Java program that uses both recursive and non-recursive functions to print nth value in the Fibonacci sequence.

Java program that prints all real solutions to the quadratic equation ax2+bx+c=0

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

Write a Java program that prints all real solutions to the quadratic equation ax2+bx+c=0. Read in a,b,c and use the quadratic formula.If the discriminant b2-4ac is negative, display a message stating that there are no real roots.

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

Free email signup