0% found this document useful (0 votes)
29 views1 page

Assignment 3

This document contains the answers to 10 multiple choice questions about Java programming concepts. It discusses how to create an array object by specifying the type and number of elements in a new expression. The enhanced for statement is mentioned as a way to iterate through an array without using a counter. A method parameter type followed by ellipsis indicates a variable number of arguments of that type can be passed. Static methods cannot access non-static class members as static methods can be called without object instantiation. TCP is stated as the protocol used to establish stream connections in Java.

Uploaded by

Alexandre Lopes
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views1 page

Assignment 3

This document contains the answers to 10 multiple choice questions about Java programming concepts. It discusses how to create an array object by specifying the type and number of elements in a new expression. The enhanced for statement is mentioned as a way to iterate through an array without using a counter. A method parameter type followed by ellipsis indicates a variable number of arguments of that type can be passed. Static methods cannot access non-static class members as static methods can be called without object instantiation. TCP is stated as the protocol used to establish stream connections in Java.

Uploaded by

Alexandre Lopes
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

GRADE: ALEXANDRE RIBEIRO LOPES 722009943 Grader: UIN:

1. TRUE 2. FALSE

3. TRUE 4. TRUE

5. FALSE 6. To create an array object, you specify the type of the array elements and the number of elements as part of an array-creation expression that uses keyword new. Such an expression returns a reference that can be stored in an array variable. Ex: int [] g = new int[10];

7. The enhanced for statement iterates through the elements of an array without using a counter, thus avoiding the possibility of stepping outside the array. 8. A type followed by an ellipsis (...) in a methods parameter list indicates that the method receives a variable number of arguments of that particular type. 9. A static method cannot access non-static class members, because a static method can be called even when no objects of the class have been instantiated. 10. To establish stream connection in java, the protocol used is TCP (Transfer Control Protocol)

You might also like