0% found this document useful (0 votes)
14 views7 pages

Practice Questions 8

Practice assignment 7

Uploaded by

bansaldhruvika8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

Practice Questions 8

Practice assignment 7

Uploaded by

bansaldhruvika8
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Q1) Create a Stack class that can hold any number of integers.

Provide
methods like push and pop. Use appropriate OOPs principles.
Hint: encapsulate an int array with some predefined size. During push
operation, if there is an overflow, then the array size should be
increased. Make sure that values are not lost in process of doing this.

Q2) Write a program to construct two matrices and display the sum of
those.
Q3) Find smallest and largest number in an array of 10 elements
without sorting the array.
Q4) Find a given no in an array
Q5) Accept ten names into an array and find the second largest name.
Q6) Write a program to taken inputs from user for two 3 x 3 Arrays and
display if both the arrays are equal or not. If not, print which elements
are not equal. Note: code should not use java.util.Arrays.equals()
method.
Q7) Write a program to take inputs from user for a 1xn array and sort it
in ascending and descending order.

You might also like