GTU SP
GTU SP
GTU SP
______________
Marks
(c) Write a program that reads an integer between 0 and 1000 and adds all 07
the digits in integer. For example if an integer is 931 then sum is 13.
JAVA 0 1000
931 13
OR
(c) Write a java program to implement Fibonacci series using Loop control 07
statement.
Q. (a) Write any four difference between procedure oriented and object 03
oriented programming language.
.2 (
(c) 07
chatAt(), contains(), format(), length(), split()
"String " Class
chatAt(),contains(), format(), length(), split().
OR
Q. (a) What is wrapper class ? Explain use of any one wrapper class. 03
2 ( Wrapper ? Wrapper
(b) 04
JAVA this"
(c) Write Java program using copy constructor to find area of rectangle. 07
1
Q. 3 (a) List types of inheritance available in JAVA. Explain single inheritance 03
with example.
.3 ( JAVA Inheritance
Single Inheritance
(b) Write a program in Java to demonstrate hierarchical inheritance. 04
JAVA hierarchical(
(c) Write a program in Java which has a class Car having two instance 07
variables topSpeed and name. Override toString() method in Car class.
Create 5 instances of Car class and print the instances.
JAVA Class topSpeed
name Class Car toString()
Class Car 5
OR
Q. 3 (a) Define abstract class in JAVA with example. 03
.3 ( JAVA Abstract Class
(b) Explain how to implement multiple inheritances in java through 04
interface.
(c) Create a user-defined package and demonstrate use that package in one 07
example.
JAVA
Q. 4 (a) List types of Errors in exceptional handling and explain any one of 03
them.
.
OR
Q. 4 (a) Explain two techniques of creating thread in Java. 03
. JAVA
(b) Explain Try and Catch in JAVA with suitable example. 04
( JAVA
(c) Write a Java program that executes three threads. One thread displays 07
(b) Write a program to create a file name 123.txt, if it does not exist. 04
Append a new data to it if it already exist.
( JAVA 123.txt
(c) Write a program in Java to create a new HashSet, add colors(in string 07
form) and iterate through all elements using for-each loop to display the
collection.
(