Bachelors Level/Fourth Year/Seventh Semester/Science csit/seventh semester/advanced java programming/syllabus wise questions

B.Sc Computer Science and Information Technology

Institute of Science and Technology, TU

Advanced Java Programming (CSC419)

Year Asked: 2080, syllabus wise question

Database Connectivity
1.
Assume a table MOVIE(id, title, genre). Now, using JDBC, perform the following queries; a. Add any three records to the MOVIE table. b. Using a prepared statement, update the genre to 'Comedy' having the title 'Jatra'. [5]
2.
Describe the role of Result Sets. What is wrong in the following code?

$\text{public class Point \{}$

$\text{int p;}$

$\text{public void setP(int p) \{}$

$\text{p = p;}$

$\text{\}}$

$\text{\}}$
[5]
GUI with JavaFX
1.
Write a JavaFX application with components, buttons, text fields, and labels, arranged in a VBox or HBox layout. [5]
Network Programming
1.
Write a TCP client-server system in which the client program sends two integers to a server program, which returns the greatest among them. [5]
Programming in Java
1.
Why do we need to synchronize the thread? Justify with an example. An array with an odd number of elements is said to be centered if all elements (except the middle one) are strictly greater than the value of the middle element. Note that only arrays with an odd number of elements have a middle element. Write a function that accepts an integer array and returns 1 if it is a centered array, otherwise it returns 0. [10]
2.
Suppose that 9 integers are written in a file named 'magic.txt' in the arrangement of 3 x 3 separated by space. Write a program to check whether the integers in all rows, all columns, and both diagonals sum to the same constant or not. [5]
RMI and CORBA
1.
List the steps to create an RMI application. Differentiate between RMI and CORBA. [5]
Servlets and Java Server pages
1.
How does JSP differ from Servlet and show the life cycle of Servlet? How do you create and read the cookies and session using JSP? Illustrate with an example. [10]
2.
What do you mean by JSP implicit objects? Discuss Java Mail API. [5]
User Interface Components with Swing
1.
Describe any two types of Layout manager. Using swing components, design a form with three buttons with captions 'RED,' 'BLUE,' and 'GREEN,' respectively. Then write a program to handle the event such that when the user clicks the button, the color of that button will be the same as its caption. [10]
2.
When do we need an internal frame? How do you create a table using Swing? [5]
3.
Write a program to create a menu named 'File' with menu items 'New', 'Save,' and 'Exit'. [5]