CSC 1250 Introduction to Java Final Exam Questions and 100% Verified Correct answers Latest Update 2025- 2026 Already Graded A+

Question 1 [25 points]:
a. What is the output of each of the following fragments? Circle the correct answer.
Output
int [] a; a = new
int[10]; a[0] = a[9] =
10;
System.out.println(a[2]);
//(3 points)
a. Syntax error
b. 10
c. 2
d. 0
int[][]M = {{3,-5},{7,2}}; for(int i
= 0; i < M.length; i++) for(int j =
0; j < M[i].length; j++)
System.out.print(M[j][i]+"\t");
//(4 points)
a. 3 -5 7 2
b. 3 7 -5 2
c. 7 2 3 -5
d. 7 3 2 -5
public static String m(int x, int y){
return ("sum=" + (x + y));
}
public static void main(String []args){
 System.out.println("L"+m(4,5));
}
//(4 points)
a. Lsum=9
b. sum=9L
c. sum=45
d. Sum=9
public static void main(String[] X){
System.out.print(m1(1));}
 public static int m1(int
a)
{ return m2(a*a -3);}
public static int m2(int b)
{return b+6;}
//(4 points)
a. Syntax error
b. 5
c. 4
d. None of the above
This study source was downloaded by 100000887486668 from CourseHero.com on 06-27-2024 03:02:42 GMT -05:00
https://www.coursehero.com/file/228081595/CSC-1250-Introduction-to-Java-Final-Exam-Questions-and-100-Verified-Correct-answers-Latest-Update-2/
b. Circle the correct answer.
How many times is the phrase "In the loop" printed?
int a = 6, b = 12;
while(a<b){
System.out.println("In the loop");
b-=2;
}
//(4 points)
a. 1
b. 2
c. 3
d. 4
Which of the following are valid array declaration?
(2 points)
a. double [3] nums = {3.5, 35.1, 32.0};
b. char [] charArray = new char[26];
c. int [] words = new words[10];
d. char [] charArray = "CSCI"; 

No comments found.
Login to post a comment
This item has not received any review yet.
Login to review this item
No Questions / Answers added yet.
Price $16.50
Add To Cart

Buy Now
Category Study Material
Comments 0
Rating
Sales 0

Buy Our Plan

We have

The latest updated Study Material Bundle with 100% Satisfaction guarantee

Visit Now
{{ userMessage }}
Processing