Java
Java
Java
___________
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
*************