Lab2 2
Lab2 2
Write a Java program to create a class known as "BankAccount" with methods called deposit()
and withdraw(). Create a subclass called SavingsAccount that overrides the withdraw() method to
prevent withdrawals if the account balance falls below one hundred.
2.create a doubly linked list and reverse the list and display
3.Read a sentence and find longest word in the sentence and display duplicate characters in it.
4.Write a java program or function to find saddle point of a matrix. Your program should take input
matrix from the user, display the matrix and find the saddle point of that matrix.
Saddle point of a matrix is an element in the matrix which is smallest in its row and largest in its
column. A matrix can have many or no saddle points. For example,
6 3 1
9 7 8
2 4 5
In this matrix, 7 is the saddle point. Because it is the smallest in its row (2nd row) and largest in its
column (2nd column)
5.Write a Java program that reads a list of numbers from a file and throws an exception if any of the
numbers are positive.
1.Write a Java program to create a class known as "BankAccount" with methods called deposit()
and withdraw(). Create a subclass called SavingsAccount that overrides the withdraw() method to
prevent withdrawals if the account balance falls below one hundred.
2.create a doubly linked list and reverse the list and display
3.Read a sentence and find longest word in the sentence and display duplicate characters in it.
4.Write a java program or function to find saddle point of a matrix. Your program should take input
matrix from the user, display the matrix and find the saddle point of that matrix.
Saddle point of a matrix is an element in the matrix which is smallest in its row and largest in its
column. A matrix can have many or no saddle points. For example,
6 3 1
9 7 8
2 4 5
In this matrix, 7 is the saddle point. Because it is the smallest in its row (2nd row) and largest in its
column (2nd column)
5.Write a Java program that reads a list of numbers from a file and throws an exception if any of the
numbers are positive.