Download - Array Q's

Transcript

8/8/2019 Array Q's

http://slidepdf.com/reader/full/array-qs 1/3

1. What is an Array? What is the other name given to it?

2. Define Subscript. What is the other name given to it?

3. Name the types of Array based on their storage pattern.

4. What is the Base type of an array?

5. What is an Initializer List? Show an example too.

6. Define - ArrayIndexOutOfBoundsException.

7. What is the 2 step process before we can use an array?

8. What is wrong in the following initialization int a={2,5,-7,9,11}; ?

9. What is wrong in the following initialization int c[]={a,b,c,d,e}; ?

10. hat will System.out.println(arr) display if arr holds {5,7,8,4,6}?

11. What will System.out.println(arr[1][1]) display if arr holds {{5,7,8},{4,6,1},{2,3,9}}?

12. Write a statement to initialize an array with the 5 uppercase vowels.

13. What is the difference between a matrix and a vector?

14. What do you understand by "An array occupies contiguous memory locations"?

15. What does the instance variable length of the array object hold?

16. Give a difference between a 2D and a 1D array.

17. How many bytes will be allocated on executing double a[][]=new double[5]2];

18. What is the other name given to sequential search?

19. What is the prerequisite to perform binary search over an array?

20. Give 2 differences between linear and binary search?

8/8/2019 Array Q's

http://slidepdf.com/reader/full/array-qs 2/3

21. Give 2 differences between selection and bubble sort?

22. Write the contents of the array {6,3,2,9,1,5,4 }after 2 passes of selection sort?

23. Write the contents of the array {6,3,2,9,1,5,4 }after 2 passes of bubble sort?

24. Give 2 limitations of arrays.

25. Give 2 advantages of arrays.

26. What will a.length give in case of (a) 1D array. (b) 2D array ?

27. What will a[i].length give in case of (a) 1D array. (b) 2D array ?

28. When do we need to nest an initializer list?

29. How do we allocate an array dynamically in java?

30. Explain with example how to initialize an array of objects.

31. What is the difference between a Vector and an Array. Discuss the advantages and

disadvantages of both?

32. Differences between Vector and Array

33. Is array aggregate assignment possible in java?

34. is Aggregate comparison of arrays possible in Java?

35. Can java array be created with zero size?

36.Is the array size is fixed after it is created?

37.How can an array of objects be created in Java?

38.An array of array can be created in java?

39. How can I convert a java array to a java.sql.Array?

40. How do you sort an array without using API

41. How do you define a Java array whose entries are also Java arrays?

8/8/2019 Array Q's

http://slidepdf.com/reader/full/array-qs 3/3

42. What are the considerations when using an array of arrays?

43. How To Sum The Elements Of An Array In Java Programming

44. How do I convert a character array to a String?