There are two ways to create threads in java, one by extending the Thread class and another is by implementing Runnable interface. When to use which option to create thread, which one is better and why? Explain with example.
What is difference between error and exception? In the case of exception handling, what is the need for finally block? Can finally block be used without catch? Explain your opinion with example.
Distinguish among Multiprocessing, Multithreading, Multitasking and Multiprogramming. How do you ensure that N thread can access N resources without deadlock?
How do we provide security to RMI classes? Write a program to implement Simple Student database application using RMI. Remote client consist of GUI for performing different database operations (For ex. Insert, delete, update) and retrieving data through RMI.
Create a Registration Form by using the following instructions:
Step 1: Create a Registration Form using Java Swing
a. Import Necessary Packages
b. Create a Frame using JFrameclass
c. Set Background color of the JFrame
d. Create JLabelfor Heading Text
e. Create a JLabel and JTextField for the name.
f. Create a JLabel and JTextField for Father’s Name
g. Create JLabel and JRadioButton for Gender
h. Create JLabel and JComboBox for Date of Birth
i. Create a JLabel and JTextArea for the Address
j. Create JLabel and JTextField for the Phone
k. Create JLabel and JTextField for the Email
l. Create a JCheckBox for Accepting License Agreement
m. Creating a JButton to Submit the Value
n. Change Font Style and Size for all the Components
o. Add all Components to the Container
p. Create a JTextArea for Output
Step 2: Add ActionListener to the Button
Add ActionListener on the Submit Button
Step 3: Read the value on the Registration Form
Read and display the value on the Registration form
Dumledore’s dining table can be thought of as an infinite row of seats with Dumbledore at one end. Each of Dumbledore’s guests represents a character of English alphabet (a to z).Dumbledore wants his guests to be seated such that the resulting string formed from the alphabets should be lexicographically smallest (See examples for reference).● Seats are allotted in sequential order, a guest who arrives later must be further from Dumbledore than a guest who arrives earlier.● An incoming guest must be assigned a seat, as soon as he arrives. He will take a seat.● Once a guest takes their seat, you can’t ask them to move to some other seat. Even if the seat in front of him is empty, they will stay at their occupied seat only.● But you can make a guest disappear using your spells, Dumbledore has allowed you to make at most ‘k’ of his guests disappear. He can handle ‘k’ guests not in the party but you can’t remove more than ‘k’ guests.
Create a program where you have to design your own Java console application about any valid problem that your application must solve. Your solution can include solving a business problem, a new idea or even a game. Your application must make use of concepts such as arrays, loops, inheritance, constructors and information hiding. Output must be shown in the form of a report using the console. Use Advanced arrays & Introduction to inheritance
Write a program that prints the sum, difference, product, quotient and remainder of two numbers. Initialize the numbers with the values 44 and 2.