push(int element)
: Adds an element to the stack.pop()
: Removes and returns the top element from the stack.displayStack()
: Displays all elements in the stack.overflow()
: Checks if the stack is full.underflow()
: Checks if the stack is empty.
- Implements the
Interface_stk
. - Represents a fixed-size stack.
- Uses an array to store stack elements.
- Operations: push, pop, displayStack.
- Checks for stack overflow and underflow conditions.
- Implements the
Interface_stk
. - Represents a growable stack.
- Uses an
ArrayList
to store stack elements. - Operations: push, pop, displayStack.
- Does not check for stack overflow, but handles underflow condition.
- Demonstrates the usage of Fixed_stk and Growable_stk.
- Creates instances of both types of stacks.
- Pushes elements into each stack, pops elements, and displays the stacks.
- Represents a student with name, roll number, and marks for two subjects.
- Provides getters and setters for each field.
Percent_cal()
: Calculates the percentage based on marks.
- Extends
Student_part2
and implementsExam
. - Calculates the percentage using
Percent_cal()
. - Displays the result including percentage, name, roll number, and marks.
- Demonstrates the usage of Result_part2.
- Creates an instance of Result_part2, passing student details and marks.
- Displays the result including the calculated percentage.