Program : Find the median of an array. Explanation : The median of an array is the middle element when the array is sorted in ascending order. In other words,…
study trigger
-
-
Java ProgramsPrograms
PRACTICE QUESTIONS ON ABSTRACT CLASS – CLASS SHAPE
by Mahesh Vermaby Mahesh VermaCreate an abstract class “Shape” with abstract methods “getArea()” and “getPerimeter()”. Implement two subclasses “Rectangle” and “Circle” which extend “Shape” and implement the abstract methods. Create a “Square” class which…
-
Java ProgramsPrograms
PRACTICE QUESTIONS ON ABSTRACT CLASS – CLASS BANK
by Mahesh Vermaby Mahesh VermaCreate an abstract class “BankAccount” with abstract methods “deposit()” and “withdraw()”. Implement two subclasses “SavingsAccount” and “CheckingAccount” which extend “BankAccount” and implement the abstract methods. Create a “Customer” class which…
-
Java ProgramsPrograms
PRACTICE QUESTIONS ON ABSTRACT CLASS – CLASS EMPLOYEE
by Mahesh Vermaby Mahesh VermaCreate an abstract class “Employee” with abstract methods “calculateSalary()” and “displayEmployeeDetails()”. Implement two subclasses “Manager” and “Worker” which extend “Employee” and implement the abstract methods. Create a “SalesPerson” class which…
-
Java ProgramsPrograms
PRACTICE QUESTIONS ON ABSTRACT CLASS – CLASS BANK CALCULATE INTEREST
by Mahesh Vermaby Mahesh VermaCreate an abstract class “Account” with abstract method “calculateInterest()”. Implement two subclasses “SavingsAccount” and “CurrentAccount” which extend “Account” and implement the “calculateInterest()” method. Create objects of both classes and test…
-
Java ProgramsPrograms
PRACTICE QUESTIONS ON ABSTRACT CLASS – CLASS MARKSHEET
by Mahesh Vermaby Mahesh VermaAn abstract class called “Marks” is needed to calculate the percentage of marks earned by students A in three subjects (with each subject out of 100) and student B in…
-
Java is an object-oriented programming language that provides several features to build robust and scalable applications. Among these features, interfaces are an essential part of Java programming, and they play…
-
Abstract classes are an important concept in object-oriented programming (OOP) and are widely used in Java. They are classes that cannot be instantiated, but can be inherited by other classes.…
-
Welcome to the article on “Practice Problems on Inheritance in Java”. Inheritance is a powerful concept in object-oriented programming, and it is important to understand its various aspects and applications.…
-
Java supports different types of inheritance that allow developers to create hierarchical structures of classes and reuse code efficiently. In our previous article “Inheritance in Java,” we discussed the concept…