Seat No.: ________ Enrolment No.
______________
GUJARAT TECHNOLOGICAL UNIVERSITY
DIPLOMA ENGINEERING – SEMESTER – V-EXAMINATION – WINTER 2015
Subject Code: 3350703 Date: 08/12/2015
Subject Name: Java Programming
Time: 10:30 AM TO 1:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make Suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
4. Use of programmable & Communication aids are strictly prohibited.
5. Use of only simple calculator is permitted in Mathematics.
6. English version is authentic.
Q.1 Answer any seven out of ten. 14
1. Describe JVM in Java.
2. List types of Inheritance in Java.
3. Define Thread in Java.
4. State the importance of Garbage collection in Java.
5. Define ‘static’ keyword in Java.
6. Define ‘bytecode’ in Java.
7. Describe stream classes in Java.
8. List out OOP concepts.
9. Define Package in Java.
10. Describe StringBuffer in Java.
Q.2 (a) Differentiate Primitive data type and user defined data type in Java. 04
OR
(a) Explain Wrapper class in Java. 04
(b) Design a class to represent account, include the following members. 05
Data member: Name of depositor, Account number, Type of account, balance
Method:
(i) To assign initial values (using constructor).
(ii) To deposit an amount after checking balance and minimum balance is
1000 Rp.
(iii) To display name and balance.
OR
(b) Write a Java program using 05
(i) Argument constructor
(ii) Copy constructor
To find the area of rectangle.
(c) Explain ‘try’ and ‘catch’ statements in exceptional handling of Java language. 02
OR
(c) Explain ‘Extending Thread class’ in Java. 02
(d) Write Java syntax to create a new text file. 03
OR
(d) Write syntax of writing a text file in Java. 03
Q.3 (a) Explain multilevel inheritance with example. 04
OR
(a) Explain interface in Java. 04
(b) Explain life cycle of thread in Java. 03
OR
(b) List types of Errors in exceptional handling and explain any one of them. 03
(c) Write a Java program to find out prime number between 1 to 100. 05
OR
(c) Write a Java program to find factorial value using command line argument. 05
(d) Write syntax of reading text file in Java. 02
OR
(d) List out I/O classes in Java. 02
Q.4 (a) Explain arrays in Java. 03
OR
(a) Explain String class in Java. 03
(b) Write a Java program to demonstrate multilevel Inheritance. 04
OR
(b) Write an application that illustrates method overriding in the different 04
packages.
(c) Write a Java program that executes three threads. One thread displays “Thread 07
– I” every 2500 millisecond, second thread displays “Thread – II” every 5000
millisecond and third thread displays “Thread – III” every 7500 millisecond.
Q.5 (a) List out Java features and explain any two of them. 05
(b) Explain Parameterized constructor and copy constructor. 05
(c) Write a Java program to demonstrate multiple Inheritances using Interface. 04
************
ુ રાતી
ગજ
પ્રશ્ન. દશમાાંથી કોઇપણ સાતના જવાબ આપો. ૧૪
૧
૧. Javaમા JVM નુ વણણન કરો.
૨. Javaમા Inheritance ના પ્રકારો લખો.
૩. Javaમા Thread ની વ્યાખ્યા આપો.
૪. Javaમા Garbage collection નુ શુ મહત્વ છે તે કહો.
૫. Javaમા ‘static’ keyword’ ની વ્યાખ્યા આપો.
૬. Javaમા ‘bytecode’ ની વ્યાખ્યા આપો.
૭. Javaમા stream classes નુ વણણન કરો.
૮. OOP ના concepts લખો.
૯. Javaમા Package ની વ્યાખ્યા આપો.
૧૦ Javaમા StringBuffer નુ વણણન કરો.
પ્રશ્ન. અ Javaમા Primitive data type અને user defined data type નો તફાવત લખો. ૦૪
ર
અથવા
અ Javaમા Wrapper class સમજાવો. ૦૪
બ Account નામનો કલાસ બનાવો કે જેમા નીચે મુજબના મેમ્બર છે . ૦૫
Data member: Name of depositor, Account number, Type of account,
balance
Method:
(i) To assign initial values (using constructor).
(ii) To deposit an amount after checking balance and minimum balance
is 1000 Rp.
(iii) To display name and balance.
અથવા
બ (i) Argument constructor ૦૫
(ii) Copy constructor
ઉપયોગ કરીને લાંબચોરસનુ ક્ષેત્રફળ શોધવાનો Java પ્રોગ્રામ લખો.
ક Javaના exceptional handlingના ‘try’ અને ‘catch’ વવધાનો સમજાવો. ૦૨
અથવા
ક Javaમા ‘Extending Thread class’ સમજાવો. ૦૨
ડ નવી text file બનાવવા માટેની Java syntax લખો. ૦૩
અથવા
ડ text fileમા write કરવા માટે ની Java syntax લખો. ૦૩
પ્રશ્ન. અ multilevel inheritance ઉદાહરણ સાથે સમજાવો. ૦૪
૩
અથવા
અ Javaમા interface સમજાવો. ૦૪
બ Javaમા threadની લાઇફ સાઇકલ સમજાવો. ૦૩
અથવા
બ exceptional handlingની વવવવધ Errors પ્રકારો લખો અને તેમાથી કોઇ પણ ૦૩
એક ને સમજાવો.
ક ૧ થી ૧૦૦ વચ્ચેના પ્રાઇમ નાંબર શોધવાનો Javaનો પ્રોગ્રામ લખો. ૦૫
અથવા
ક command line argumentની મદદથી factorial value શોધવાનો Javaનો ૦૫
પ્રોગ્રામ લખો.
ડ text fileને read કરવા માટે ની Java syntax લખો. ૦૨
અથવા
ડ Javaમા I/O classes ના પ્રકારો લખો. ૦૨
પ્રશ્ન. અ Javaમા arrays સમજાવો. ૦૩
૪
અથવા
અ Javaમા String class સમજાવો. ૦૩
બ multilevel Inheritanceને સમજાવતી Java પ્રોગ્રામ લખો. ૦૪
અથવા
બ વવવવધ પેકેજ મા method overridingને સમજાવતો application લખો. ૦૪
ક ત્રણ threadને execute કરતો જાવા પ્રોગ્રામ લખો. પ્રથમ thread દર ૨૫૦૦ ૦૭
મીલીસેકન્ડે “Thread – I” ડીસપ્લે કરશે, બીજુ thread દર ૫૦૦૦ મીલીસેકન્ડે
“Thread – II” ડીસપ્લે કરશે અને ત્રીજુ thread દર ૭૫૦૦ મીલીસેકન્ડે
“Thread – III” ડીસપ્લે કરશે
પ્રશ્ન. અ Java ના features લખો અને તેમાથી કોઇ પણ બે ને સમજાવો. ૦૫
૫
બ Parameterized constructor અને copy constructor સમજાવો. ૦૫
ક Interface નો ઉપયોગ કરીને multiple Inheritance ને સમજાવતો Java પ્રોગ્રામ ૦૪
લખો.
************