JAVA-Practicals of B.Sc. (Hons.) Computer Science (1st year)

JAVA-Practicals

B.Sc. (Hons.) Computer Science
1st year

  1. To find the sum of any number of integers entered as command line arguments
  2. To find the factorial of a given number
  3. To learn use of single dimensional array by defining the array dynamically.
  4. To learn use of in case of a two dimensional array
  5. To convert a decimal to binary number
  6. To check if a number is prime or not, by taking the number as input from the keyboard
  7. To find the sum of any number of integers interactively, i.e., entering every number from the keyboard, whereas the total number of integers is given as a command line argument
  8. Write a program that show working of different functions of String and StringBufferclasss like setCharAt(, setLength(), append(), insert(), concat()and equals().
  9. Write a program to create a “distance” class with methods where distance is computed in terms of feet and inches, how to create objects of a class and to see the use of this pointer
  10. Modify the “distance” class by creating constructor for assigning values (feet and inches) to the distance object. Create another object and assign second object as reference variable to another object reference variable. Further create a third object which is a clone of the first object.
  11. Write a program to show that during function overloading, if no matching argument is found, then java will apply automatic type conversions(from lower to higher data type)
  12. Write a program to show the difference between public and private access specifiers. The program should also show that primitive data types are passed by value and objects are passed by reference and to learn use of final keyword
  13. Write a program to show the use of static functions and to pass variable length arguments in a function.
  14. Write a program to demonstrate the concept of boxing and unboxing.
  15. Create a multi-file program where in one file a string message is taken as input from the user and the function to display the message on the screen is given in another file (make use of Scanner package in this program).
  16. Write a program to create a multilevel package and also creates a reusable class to generate Fibonacci series, where the function to generate Fibonacii series is given in a different file belonging to the same package.
  17. Write a program that creates illustrates different levels of protection in classes/subclasses belonging to same package or different packages
  18. Write a program “DivideByZero” that takes two numbers a and b as input, computes a/b, and invokes Arithmetic Exception to generate a message when the denominator is zero.
  19. Write a program to show the use of nested try statements that emphasizes the sequence of checking for catch handler statements.
  20. Write a program to create your own exception types to handle situation specific to your application (Hint: Define a subclass of Exception which itself is a subclass of Throwable).

2 comments:

  1. It's all the same as on our syllabus of 3rd Semester.... Thank you for your help.. 🌸🌸

    ReplyDelete

Pageviews