What is the output of the following piece of code int data
What is the output of the following piece of code? int[] data = {1, 2, 3, 4}; int count = 5; if(count < data.length) System.out.println(\"There are four elements in the array\"); else System.out.println(\"Array is full.\"); Solution
The output is :
Array is full
Explanation:
data.length = 4 so count>data.length so it will print Array is full
![What is the output of the following piece of code? int[] data = {1, 2, 3, 4}; int count = 5; if(count < data.length) System.out.println(\ What is the output of the following piece of code? int[] data = {1, 2, 3, 4}; int count = 5; if(count < data.length) System.out.println(\](/WebImages/6/what-is-the-output-of-the-following-piece-of-code-int-data-987577-1761507501-0.webp)