Differentiate following:
[4 marks](i) What happens when your program attempts to access an array element with an invalid index? (ii) What are the benefits of data field encapsulation? (iii) What is the registration method for a button to register an Action Event handler?
[3 marks]abstract class with interface (ii) String with String Buffer
[ marks]Write a method that returns a new array by eliminating the duplicate values in the array using the following method header: public static int[] eliminate Duplicates(int[] list). Write a test program that reads in ten integers, invokes the method, and displays the result.
[7 marks]Compare static methods with instance methods.
[3 marks]How do you create a button with a text and a node? How do you set a handler for processing a button-clicked action?
[4 marks]What is exception? Explain the use of exception handling keywords with example.
[7 marks]How do interfaces support polymorphism? Explain with example.
[7 marks]What is polymorphism? What is dynamic binding?
[3 marks]Explain the use of File class to handle I/O.
[4 marks]Write the bin2Dec(String binary String) method to convert a binary string into a decimal number. Implement the bin2Dec method to throw a Number Format Exception if the string is not a binary string.
[7 marks]How do you prevent a class from being extended? How do you prevent a method from being overridden?
[3 marks]Differentiate the followings:
[4 marks]Checked and Unchecked Exceptions (ii) Text I/Oand Binary I/O
[ marks]Write a program that lets users copy files. The user needs to provide a source file and a target file as command-line arguments using the command: java Copy source target1
[7 marks]Define the compare To method in a class implementing the Comparable interface. What are the benefits of implementing the Comparable interface?
[3 marks]What do you understand by thread? Describe the complete life cycle of thread.
[4 marks]Describe and compare Hash Map, Linked Hash Map, and Tree Map.
[7 marks]What is a recursive method? Write a recursive mathematical definition for computing 2n for a positive integer n.
[3 marks]What do you mean by thread synchronization? How can you synchronize java threads?
[4 marks]Write a program to add ten elements in a list and traverse a list in both directions.
[7 marks]What are the benefits of using generic types? How do you declare a generic type in a class?
[3 marks]Which method do you use to obtain an element in the collection from an iterator? Explain with example.
[4 marks]Which layout panes are supported by JavaFX? Write a program to create a login screen using Grid Pane.
[7 marks]How do you declare and invoke a generic method?
[3 marks]How do create and use anonymous inner class?
[4 marks]Write a program to define and register handlers for key pressed, key released, and key typed events using JavaFX.
[7 marks]