Task 2: Create a class in java for a N x N array (matrix) which includes methods to do the
i. To check whether the immediate neighbors of central element are multiples of
central element or not.
ii. To store immediate neighbors, which are multiples of central element in new
one dimensional array.
Write and execute a java program to create an object of this class, accept a NxN array (matrix)
from the user and demonstrate the working of above mentioned methods. (15+20 =35marks)
Example: Consider the below 3X3 matrix
12 24 36
30 6 48
42 48 65
i. Central element is 6, its immediate neighbors are multiples of 6 except for 65.
ii. Create a new one dimensional matrix size of 1X7 to store these neighbors (as 65 is not
multiple of 6)
12 24 36 30 48 42 48
Task 3: Write and execute JAVA program to implement a method,which can be used to find
common values present in two single linked lists and the display appropriate message.The
program should have appropriate methods to create and display the single linked lists by
taking values from user.