SR.
PRACTICALS STARTING SUBMISSION TEACHER
NO. DATE DATE SIGNATURE
1. Write a Java Program to
display the count of all
commands line arguments
and list each in a line.
2. Write a program to find out
sum of digits of given
number.
3. Write a program to display
multiplication table in row,
column format.
4. Write a program to
(a). To find whether the
given number is prime or
not.
(b). To display all prime
numbers in a given range of
numbers.
5. Write a program to create
an array of integers and
accept a number. Check
whether it exits in the
array. Create your own
expectation with
appropriate error message
and raise the exception
when the element is not
found in the array.
6. Write a program to copy a
file to another file using
java.io package classes.
7. Write a program to get a
file at runtime and display
the number of lines, words
and characters in that file.
8. Programming exercise on
Arrays and Strings.
9. Programming exercise on
Inheritance.
10. Write program for
exception handling.
11. Write programs for
Multithreading.
12. Programming exercise on
Java applets.
13. Write a program for Java
Database connectivity.
Practical 1: Write a Java Program to display the count of all commands
line arguments and list each in a line.
Program:
Output:
Practical 2:Write a program to find out sum of digits of given number.
Program:
Output:
Practical 3: Write a program to display multiplication table in row,
column format.
Program:
Output:
Practical 4: Write a program to
(a). To find whether the given number is prime or not
Program:
Output:
(b). To display all prime numbers in a given range of numbers.
Program:
Output:
Practical 5: Write a program to create an array of integers and accept a
number. Check whether it exits in the array. Create your own
expectation with appropriate error message and raise the exception
when the element is not found in the array.
Part 1:
Program:
Output:
Part 2:
Program:
Output:
Practical 6: Write a program to copy a file to another file using java.io
package classes.
Program:
Output:
Practical 7: Write a program to get a file at runtime and display the
number of lines, words and characters in that file.
Program:
Output:
Practical 8: Programming exercise on Arrays and Strings.
(a).Write a program in java to reverse an array.
Program:
Output:
(b).Write a program in java to find maximum value in array.
Program:
Output:
(c). Write a program in java to reverse string.
Program:
Output:
(d).Write a program in java string in upper case.
Program:
Output:
(e).Write a program in java to sort the value in array.
Program:
Output:
(f).Write a program in java to count the occurrence of the given
character in string.
Program:
Output:
Practical 9: Programming exercise on Inheritance.
(a). Write a program in java to create a class animal1 with a method
make sound. Create a sub class called catinheritance that overrides the
make sound() method to dark.
Program:
animal1:
catinheritance:
mainanimal:
Output:
(b).Write a program to create a program to create a class known as
bankaccount with methods called deposit() and withdraw(). Create a
subclass called savingsaccount that overrides the withdraw() method to
prevent withdraws if the account balance falls below one hundred.
Program:
bankaccount:
savingsaccount:
mainbank:
Output: