Please answer all of the questions the questions are asking about java programs
ID: 3694426 • Letter: P
Question
Please answer all of the questions the questions are asking about java programs in this instance.
1. An array is a group of variables, and it can only take the same type values (True/False).
2.The elements of an array can be primitive types, but not reference types(True/False).
3. An index of an array must be int value or a byte, short, or char type value(True/False).
4.
Question: what’s the difference between
int[ ] a, b, c; and int a[ ], b, c; ?
5. What’s the difference between byte-based streams and character-based streams (binary
file and text file)?
6. Two ways to pass arguments in method calls in many programming languages are call-by-value and call-by-reference.When a method modifies a primitive-type parameter, changes to the parameter have no effect on the original argument value in the calling method. (True/False)
7.When a method modifies a reference-type parameter, changes to the parameter will also change the original argument value in the calling method. (True/False)
Explanation / Answer
1.
An array is a collection of elements of same data type. so an array can take only the same type values. so the given statement "An array is a group of variables, and it can only take the same type values" is TRUE.
2.
the given statement is FALSE. this is because the element of an array can be of any type both primitive or reference.
3.
the given statement is TRUE.This is because an array can be indexed by int values. short, byte and char are subjected to unary promotions and become int values.
4.
byte based streams are end up calling by word stream and are used to process a raw byte at a time. character based streams are used for handling character inputs and outputs. they end up calling reader or writer.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.