Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The class attributes can be from any. Behavior. Primitive datatype only Primitive datatype or object Method The ... access modifier indicates that the variable or
- The class attributes can be from any.
- Behavior.
- Primitive datatype only
- Primitive datatype or object
- Method
- The ... access modifier indicates that the variable or method can be accessed within
- public
- private
- protected
- static
- The method that has the same class name and has no return value is called
- constructor
- implementor
- method with no return value
- package
- Usually, the (a) method has a return value while the ..(b). Method takes
- (a)getter ,(b) setter
- (a)setter , (b) getter
- (a) setter , (b) toString
- None
- The .(a). Is used to find an element in unsorted array while the .(b).. is used in sorted array
- (a) Binary search , (b) Sequential search
- (a) selection search , (b) Sequential search
- (a) Sequential search , (b) Binary search
- (a) selection search , (b) Binary search
- The . Keyword indicates that only one copy of the class variable will be used for
- static
- private
- protected
- public
- The following code is used to swap the elements at the indexes . of the array
Student temp = A[maxLoc];
A[maxLoc] = A[lastPlace];
A[lastPlace] = temp
- Student and temp
- maxLoc and lastPlace
- maxLoc and temp
- lastPlace and temp
- The is used to store an array of un-known size to dynamically increase/shrink
- ArrayList
- Cart array
- Collections
- String array
- The . Java built-in class can be used to sort an arrayList using its method sort.
- ArrayList
- Cary array
- String array
- Collections
- The method .. in the ArrayList class can be used to insert an element either to the a specific location/index.
- contains
- add
- remove
- get
- .. appears when trying to access an array's element that its position is negative or greater than or equals to the array's length.
- User-defined exceptions
- Built-in Exception
- ArraysIndexOutOfBoundsException
- NegativeArraySizeException
- The value of ( first , last and mid ) to find (9) in the following list using binary search:
1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- first = 5 , last = 9 , mid = 7
- first = 8 , last = 9 , mid = 8
- first = 5 , last = 9 , mid = 7
- first = 0 , last = 9 , mid = 4
- The appropriate statement to retrieve the second row length of a two-dimensional array ( arr) is:
- arr.length
- arr[1].length
- arr[0].length
- arr[2].length
- Which sentence is accurate for the following array?
int [ ] [ ] arr = { { 1 } , { 2, 3, 4}, {5, 6 } };
- The array has one row.
- The array has three rows.
- The array has three column.
- The array's length is dynamic.
- Array can be created by
- new operator
- user-defined class
- direct contents initialization
- all of above
- The next step to sort the following list using selection sort is:
52, 93, 88, 73, 3, 12
- 52, 93, 12, 73, 3, 88
- 52, 12, 88, 73, 3, 96
- 93, 52, 88, 73, 3, 12
- 12, 93, 88, 73, 3, 52
- When a variable is declared as final, it cannot be changed.
- True
- False
- Linear search is more efficient than binary search.
- True
- False
- The appropriate statement that will remove all elements of an arrayList (list) is
- list.contains()
- list.remove()
- list.clear()
- list.sort()
- In . , the order of elements is required.
- binary search
- two-dimensional array
- linear search
- arrayList
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started