Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Java

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

Seat No.: ________ Enrolment No.

___________

GUJARAT TECHNOLOGICAL UNIVERSITY


BE - SEMESTER–V (NEW) EXAMINATION – WINTER 2018
Subject Code:2150704 Date:11/12/2018
Subject Name:Object Oriented Programming using JAVA
Time: 10:30 AM TO 01:00 PM Total Marks: 70
Instructions:
1. Attempt all questions.
2. Make suitable assumptions wherever necessary.
3. Figures to the right indicate full marks.
MARKS
Q.1 (a) Define following. 03
1) Byte code
2) Java Virtual Machine
3) Unicode
(b) Write a program which takes five numbers as command line 04
argument from user, store them in one dimensional array and
display count of negative numbers.
(c) What do you mean by Interface? Compare interface and abstract 07
class with suitable example.

Q.2 (a) When will you declare a method as a static? Explain static method 03
with suitable example.
(b) Explain inner class with example. 04
(c) Explain following keywords of java with example. 07
1) final
2) finally
OR
(c) Explain following keywords of java with example. 07
1) super
2) this
Q.3 (a) What is java collection framework? What are the benefits of the 03
java collection framework?
(b) What is Exception? Demonstrate how you can handle different 04
types of exception separately.
(c) What is dynamic method dispatch? Explain with suitable 07
example.
OR
Q.3 (a) What is wrapper class? What is the use of wrapper class in Java? 03
(b) What do you mean by Overloading? Explain constructor 04
overloading with suitable example.
(c) Explain following keywords with example 07
1) throw
2) throws
Q.4 (a) Write a program that reads file name from user, through command 03
line argument and displays/reads content of the text file on
console.
(b) What is package? What are the requirements of it? What we can 04
achieve using package?
(c) What is multithreading? What are the ways in which you can 07
create a thread? Explain with Example

1
OR
Q.4 (a) Write a program that accepts name of website from user, and 03
displays IP address of it on console.
(b) What will be the output of following code snippet? 04
(1)
class evaluate {
public static void main(String args[])
{
int arr[] = new int[] {0 , 1, 2, 3, 4, 5, 6, 7, 8, 9};
int n = 6;
n = arr[arr[n] / 2];
System.out.println(arr[n] / 2);
}
}
(2)
class equality {
int x;
int y;
boolean isequal()
{
return(x == y);
}
}
class Output {
public static void main(String args[])
{
equality obj = new equality();
obj.x = 5;
obj.y = 5;
System.out.println(obj.isequal());
}
}
(c) Explain use of following methods with suitable example 07
isAlive(), join(), setPriority().
Q.5 (a) What is use of fork and join in activity diagram? Explain with 03
suitable example.
(b) What is UML? Explain Class Model, State Model and Interaction 04
Model in brief.
(c) Draw class diagram of bank management system. 07
OR
Q.5 (a) What is usefulness of sequence diagram? List components of it. 03
(b) Explain generalization in class diagram with example. 04
(c) Draw use case diagram for hotel management system. 07

*************

You might also like