• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 11 pages
Exam (elaborations)

Java Programming Exam Questions And Answers 100% Verified And Updated.

Document preview thumbnail
Preview 2 out of 11 pages

Java Programming Exam Questions And Answers 100% Verified And Updated. ________ represents an entity in the real world that can be distinctly identified. - AnswerAn Object ________ is a construct that defines objects of the same type. - AnswerA class An object is an instance of a ________ - Answerclass The keyword ________ is required to declare a class. - Answerclass ________ is invoked to create an object. - AnswerA constructor The default value for data field of a boolean type, numeric type, object type is ________, respectively - Answerfalse, 0, null public class Test{ int x; public Test(String t){ Sln("Test"); } public static void main(String[] args){ Test test = new Test(); Sln(test.x); } } - AnswerThe program has a compile error because Test does not have a default constructor Java assigns a default value to a date member of a class if the data is not initialized - AnswerTrue ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED. 2 | P a g e The default constructor has no arguments - AnswerTrue You can access a class variable using a syntax like objectNVariable or ClassNVariable - AnswerTrue Which one of the following statements are correct - Answerchar[][] charArray = {{'a','b'}, {'c','d'}} Assume double[][] x = new double[4][5], what are h and x[2].length? - Answer4 and 5 What is the index variable for the element at the first row and first column in array a? - Answera[0][0] ___is the physical aspect of the computer that can be seen - Answerhardware How many Elements are array matrix (int[][] matrix = new int[5][5])? - Answer25 Assume int[][][] x = new char [2][5][3], how many elements are there in the array? - Answer30 What is the printout of the following program? program public class Test{ public static void main(String[] args){ int[][] values = {{3, 4, 5, 2}, {33, 6, 1, 2}}; for (int row = 0; row h; row++){ .A(Values[row].length; column++); S(values[row][column]+" "); Sln(); } } } - AnswerThe program prints two rows 1 3 4 5 followed by 1 2 6 33 What is the output for the following code? public class test{ public static void main(String[] a

Content preview

©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.




Java Programming Exam Questions And
Answers 100% Verified And Updated.



________ represents an entity in the real world that can be distinctly identified. - Answer✔An
Object
________ is a construct that defines objects of the same type. - Answer✔A class
An object is an instance of a ________ - Answer✔class

The keyword ________ is required to declare a class. - Answer✔class

________ is invoked to create an object. - Answer✔A constructor
The default value for data field of a boolean type, numeric type, object type is ________,
respectively - Answer✔false, 0, null
public class Test{
int x;


public Test(String t){
System.out.println("Test");
}


public static void main(String[] args){
Test test = new Test();
System.out.println(test.x);
}
} - Answer✔The program has a compile error because Test does not have a default constructor
Java assigns a default value to a date member of a class if the data is not initialized -
Answer✔True

1|Page

, ©FYNDLAY 2024/2025 ALL RIGHTS RESERVED.

The default constructor has no arguments - Answer✔True
You can access a class variable using a syntax like objectName.classVariable or
ClassName.classVariable - Answer✔True
Which one of the following statements are correct - Answer✔char[][] charArray = {{'a','b'},
{'c','d'}}
Assume double[][] x = new double[4][5], what are x.length and x[2].length? - Answer✔4 and 5
What is the index variable for the element at the first row and first column in array a? -
Answer✔a[0][0]
___is the physical aspect of the computer that can be seen - Answer✔hardware

How many Elements are array matrix (int[][] matrix = new int[5][5])? - Answer✔25
Assume int[][][] x = new char [2][5][3], how many elements are there in the array? - Answer✔30
What is the printout of the following program?


program public class Test{
public static void main(String[] args){
int[][] values = {{3, 4, 5, 2}, {33, 6, 1, 2}};
for (int row = 0; row < values.length; row++){
java.util.Arrays.sort(Values[row].length; column++);
System.out.print(values[row][column]+" ");
System.out.println();
}
}
} - Answer✔The program prints two rows 1 3 4 5 followed by 1 2 6 33
What is the output for the following code?


public class test{
public static void main(String[] args){
int[][] matrix =
{{1, 2, 3, 4},
{4, 5, 6, 7,},

2|Page

Document information

Uploaded on
January 24, 2025
Number of pages
11
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers
$10.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Fyndlay
3.6
(79)
Sold
439
Followers
82
Items
21994
Last sold
3 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions