Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
9.8k views
in Computer by (48.9k points)
closed by

A class Mixer has been defined to merge two sorted integer arrays in ascending order. Some of the members of the class are given below:

Class name: Mixer 

Data members/instance variables: 

int arr[ ]: to store the elements of an array 

int n: to store the size of the array 

Member functions: 

Mixer(int nn): constructor to assign n=nn 

void accept(): to accept the elements of the array in ascending order without any duplicates

Mixer mix (Mixer A): to merge the current object array elements with the parameterized array elements and return the resultant object 

void display(): to display the elements of the array 

Specify the class Mixer, giving details of the constructor(int), void accept(), Mixer 

mix(Mixer) and void display(). Define the main( ) function to create an object and call 

the function accordingly to enable the task.

1 Answer

+1 vote
by (49.8k points)
selected by
 
Best answer

import java.util.*; 

class Mixer 

{

intarr[]; 

int n; 

static Scanner sc=new Scanner(System.in); 

Mixer(int nn) 

n=nn; 

arr=new int[n]; 

}

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

Categories

...