SlideShare a Scribd company logo
1 of 14
Download to read offline
All based on Zybooks = AP Java with zylabs
QUESTION 1
char[][] table = new char[10][5];
How many rows are in the array seen in the accompanying figure?
0
5
10
15
QUESTION 2
The standard output object in Java is ____.
output
System.out
Sys.out
System.in
QUESTION 3
The length of the string "first java program" is:
16
18
19
20
1 points
QUESTION 4
The loop condition of a while loop is reevaluated before every iteration of the loop.
True
False
1 points
QUESTION 5
If str1 is “Hello” and str2 is “Hi”, which of the following could not be a result of
str1.compareTo(str2);?
-9
-5
-1
1
1 points
QUESTION 6
Both System.out.println and System.out.print can be used to output a string on the standard
output device.
True
False
1 points
QUESTION 7
In a method call statement, when passing an array as an actual parameter, you use only its name.
True
False
1 points
QUESTION 8
Which of the following is true about a while loop?
The body of the loop is executed at least once.
The logical expression controlling the loop is evaluated before the loop is entered and after the
loop exists.
The body of the loop may not execute at all.
It is a post-test loop
1 points
QUESTION 9
int x, y;
if (x < 4)
y = 2;
else if (x > 4)
{
if (x > 7)
y = 4;
else
y = 6;
}
else
y = 8;
Based on the code above, what is the value of y if x = 9?
2
4
6
8
1 points
QUESTION 10
The array index can be any nonnegative integer less than the array size.
True
False
1 points
QUESTION 11
When a program executes, the first statement to execute is always the first statement in the main
method.
True
False
1 points
QUESTION 12
Java stores two-dimensional arrays in a row order form in computer memory.
True
False
1 points
QUESTION 13
The statement dataType[][][] arrayName; would declare a two-dimensional array.
True
False
1 points
QUESTION 14
All the methods defined in a class must have different names.
True
False
1 points
QUESTION 15
Which of the following is NOT a reserved word in Java?
double
throws
static
num
1 points
QUESTION 16
Given the declaration
int[] list = new int[50];
the statement
System.out.println(list[0] + "..." + list[49]);
outputs all 50 components of the array list.
True
False
1 points
QUESTION 17
In the case of an infinite while loop, the while expression (that is, the loop condition) is always
true.
True
False
1 points
QUESTION 18
Consider the following program.
public class CircleArea
{
static Scanner console = new Scanner(System.in);
static final double PI = 3.14;
public static void main(String[]args)
{
doubler;
double area;
r = console.nextDouble();
area = PI * r * r;
System.out.println("Area = " + area);
}
}
To successfully compile this program, which of the following import statement is required?
import java.io.Scanner;
import java.util.Scanner;
import java.lang.Scanner;
No import statement is required
1 points
QUESTION 19
An identifier can be any sequence of characters and integers.
True
False
1 points
QUESTION 20
A single array can hold elements of many different data types.
True
False
1 points
QUESTION 21
Consider the following program.
// Insertion Point 1
public class CircleArea
{
// Insertion Point 2
static final float PI = 3.14
public static void main(String[]args)
{
//Insertion Point 3
float r = 2.0;
float area;
area = PI * r * r;
System.out.println("Area = " + area);
}
// Insertion Point 4
}
In the above code, where do the import statements belong?
Insertion Point 1
Insertion Point 2
Insertion Point 3
Insertion Point 4
1 points
QUESTION 22
Suppose that x is an int variable. Which of the following expressions always evaluates to false?
(x > 0) || (x <= 0)
(x > 0) || (x == 0)
(x > 0) && ( x <= 0)
(x >= 0) && (x == 0)
1 points
QUESTION 23
What is the value of alpha[4] after the following code executes?
int[] alpha = new int[5];
for (int j = 0; j < 5; j++)
alpha[j] = 2 * j - 1;
one
three
five
seven
1 points
QUESTION 24
If a = 4; and b = 3;, then after the statement a = b; executes, the value of b is 4 and the value of a
is 3.
True
False
1 points
QUESTION 25
The expression !(x <= 0) is true only if x is a positive number.
True
False
1 points
QUESTION 26
In a return method, the last line of the method must be a return statement.
True
False
1 points
QUESTION 27
The expression (int)8.7 evaluates to ____.
8
8.0
9.0
9
1 points
QUESTION 28
A loop is a control structure that causes certain statements to be executed over and over until
certain conditions are met.
True
False
1 points
QUESTION 29
What is stored in alpha after the following code executes?
int[] alpha = new int[5];
for (int j = 0; j < 5; j++)
{
alpha[j] = 2 * j;
if (j % 2 == 1)
alpha[j - 1] = alpha[j] + j;
}
alpha = {0, 2, 4, 6, 8}
alpha = {3, 2, 9, 6, 8}
alpha = {0, 3, 4, 7, 8}
alpha = {0, 2, 9, 6, 8}
1 points
QUESTION 30
Suppose that x and y are int variables and x = 7 and y = 8. After the statement: x = x * y - 2;
executes, the value of x is ____.
42
54
56
58
1 points
QUESTION 31
A counter-controlled loop should be used when the programmer knows the exact number of loop
iterations are needed.
True
False
1 points
QUESTION 32
In Java, a period is used to terminate a statement.
True
False
1 points
QUESTION 33
In Java, return is a reserved word.
True
False
1 points
QUESTION 34
When an array reference is passed to a method, the method can modify the elements of the array
object.
True
False
1 points
QUESTION 35
A local identifier is an identifier that is declared within a method or block and that is visible only
within that method or block.
True
False
1 points
QUESTION 36
An expression such as str.length(); is an example of a(n) ____.
system call
object call
class
method call
1 points
QUESTION 37
Suppose str1 and str2 are String variables. The expression (str1 == str2) determines whether str1
and str2 reference the same String object.
True
False
1 points
QUESTION 38
Just like the nesting of loops, Java allows the nesting of methods.
True
False
1 points
QUESTION 39
Suppose console is a Scanner object initialized with the standard input device. The expression
console.nextInt(); is used to read one int value and the expression console.nextDouble(); is used
to read two int values.
True
False
1 points
QUESTION 40
A compiler translates the assembly language instructions into machine language.
True
False
1 points
QUESTION 41
An identifier can be declared anywhere including within a class, and outside of every method
definition (and every block).
True
False
1 points
QUESTION 42
The following for loop executes 21 times. (Assume all variables are properly declared.)
for (i = 1; i <= 20; i = i + 1)
System.out.println(i);
True
False
1 points
QUESTION 43
Which of the following is the array subscripting operator in Java?
.
{}
new
[]
1 points
QUESTION 44
char[][] table = new char[10][5];
How many columns are in the array seen in the accompanying figure?
0
5
10
15
1 points
QUESTION 45
The digit 0 or 1 is called a ____.
bit
bytecode
Unicode
hexcode
1 points
QUESTION 46
The output of the following Java code is: Stoor.
int count = 5;
System.out.print("Sto");
do
{
System.out.print('o');
count--;
}
while (count >= 5);
System.out.println('r');
True
False
1 points
QUESTION 47
The expression (double)(5 + 4) evaluates to ____.
8
9
9.0
10.0
1 points
QUESTION 48
In Java, !, &&, and || are called logical operators.
True
False
1 points
QUESTION 49
int x, y;
if (x < 4)
y = 2;
else if (x > 4)
{
if (x > 7)
y = 4;
else
y = 6;
}
else
y = 8;
Based on the code above, what is the value of y if x = 4?
2
4
6
8
1 points
QUESTION 50
What is the output of the following code?
int count;
int num = 2;
for (count = 1; count < 2; count++)
{
num = num + 3;
System.out.print(num + " ");
}
System.out.println();
5
5 8
2 5 8
5 8 11
0
5
10
15
Solution
Answer :
QUESTION 1
char[][] table = new char[10][5];
How many rows are in the array seen in the accompanying figure?
Answer :
10
..................
QUESTION 2
The standard output object in Java is ____.
Answer :
System.out
Explanation:
In java System.out is the standard output object.
................
QUESTION 3
The length of the string "first java program" is:
Answer :
18
Explanation :
first java program
5+1+4+1+7=18
............
QUESTION 4
The loop condition of a while loop is reevaluated before every iteration of the loop.
True
False
Answer :
True
Explanation :
Yes,it is true.The while loop is reevaluated before every iteration of the loop
................
QUESTION 6
Both System.out.println and System.out.print can be used to output a string on the standard
output device.
True
False
Answer :
True
..........................
QUESTION 15
Which of the following is NOT a reserved word in Java?
Answer :
num
.................
QUESTION 47
The expression (double)(5 + 4) evaluates to ____.
Answer :
9.0
Explanation :
Double is floating point type
so (double)(5+4)=9.0
.....................
QUESTION 50
What is the output of the following code?
int count;
int num = 2;
for (count = 1; count < 2; count++)
{
num = num + 3;
System.out.print(num + " ");
}
System.out.println();
Answer : 5
Explanation :
int num = 2;
for (count = 1; count < 2; count++) //1<2 T //2<2 F
{
num = num + 3; // 2+3
System.out.print(num + " "); //5
}
System.out.println();

More Related Content

Similar to All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf

1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docxhoney725342
 
Computer science ms
Computer science msComputer science ms
Computer science msB Bhuvanesh
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Nishan Barot
 
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxPage 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxalfred4lewis58146
 
Computer java programs
Computer java programsComputer java programs
Computer java programsADITYA BHARTI
 
LeetCode Solutions In Java .pdf
LeetCode Solutions In Java .pdfLeetCode Solutions In Java .pdf
LeetCode Solutions In Java .pdfzupsezekno
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2Abdul Haseeb
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and ClassesIntro C# Book
 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Ziyauddin Shaik
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentalsHCMUTE
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Intel® Software
 

Similar to All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf (20)

Review version 4
Review version 4Review version 4
Review version 4
 
1 Midterm Preview Time allotted 50 minutes CS 11.docx
1  Midterm Preview Time allotted 50 minutes CS 11.docx1  Midterm Preview Time allotted 50 minutes CS 11.docx
1 Midterm Preview Time allotted 50 minutes CS 11.docx
 
Computer science ms
Computer science msComputer science ms
Computer science ms
 
7
77
7
 
Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.Final JAVA Practical of BCA SEM-5.
Final JAVA Practical of BCA SEM-5.
 
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docxPage 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
Page 1 Multiple Choice QuestionsQuestion 1.1. (TCO 1) What.docx
 
Arrays in Java
Arrays in JavaArrays in Java
Arrays in Java
 
Computer java programs
Computer java programsComputer java programs
Computer java programs
 
Mcq cpup
Mcq cpupMcq cpup
Mcq cpup
 
10. Recursion
10. Recursion10. Recursion
10. Recursion
 
LeetCode Solutions In Java .pdf
LeetCode Solutions In Java .pdfLeetCode Solutions In Java .pdf
LeetCode Solutions In Java .pdf
 
Python programming workshop session 2
Python programming workshop session 2Python programming workshop session 2
Python programming workshop session 2
 
05. Java Loops Methods and Classes
05. Java Loops Methods and Classes05. Java Loops Methods and Classes
05. Java Loops Methods and Classes
 
Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )Introduction to python programming ( part-2 )
Introduction to python programming ( part-2 )
 
Java introduction
Java introductionJava introduction
Java introduction
 
Lecture 2 java.pdf
Lecture 2 java.pdfLecture 2 java.pdf
Lecture 2 java.pdf
 
UNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptxUNIT 2 LOOP CONTROL.pptx
UNIT 2 LOOP CONTROL.pptx
 
Java fundamentals
Java fundamentalsJava fundamentals
Java fundamentals
 
Introduction to python programming
Introduction to python programmingIntroduction to python programming
Introduction to python programming
 
Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*Tools and Techniques for Understanding Threading Behavior in Android*
Tools and Techniques for Understanding Threading Behavior in Android*
 

More from aroraenterprisesmbd

In the following list, which term is least related to the others tr.pdf
In the following list, which term is least related to the others  tr.pdfIn the following list, which term is least related to the others  tr.pdf
In the following list, which term is least related to the others tr.pdfaroraenterprisesmbd
 
If your organization is going to apply for a grant, when do you thin.pdf
If your organization is going to apply for a grant, when do you thin.pdfIf your organization is going to apply for a grant, when do you thin.pdf
If your organization is going to apply for a grant, when do you thin.pdfaroraenterprisesmbd
 
If the characteristic followed in the pedigree is x-linked recessive .pdf
If the characteristic followed in the pedigree is x-linked recessive .pdfIf the characteristic followed in the pedigree is x-linked recessive .pdf
If the characteristic followed in the pedigree is x-linked recessive .pdfaroraenterprisesmbd
 
I want to know the purpose of parting lineSolutionA parting li.pdf
I want to know the purpose of parting lineSolutionA parting li.pdfI want to know the purpose of parting lineSolutionA parting li.pdf
I want to know the purpose of parting lineSolutionA parting li.pdfaroraenterprisesmbd
 
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdf
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdfHTML5 & JqueryJavascriptI am trying to code a image slider and I.pdf
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdfaroraenterprisesmbd
 
How to access this window in ANSYS (Picture 1 contains analysis s.pdf
How to access this window in ANSYS (Picture 1 contains analysis s.pdfHow to access this window in ANSYS (Picture 1 contains analysis s.pdf
How to access this window in ANSYS (Picture 1 contains analysis s.pdfaroraenterprisesmbd
 
How and when do we learn ethicsHow and when do we learn ethics.pdf
How and when do we learn ethicsHow and when do we learn ethics.pdfHow and when do we learn ethicsHow and when do we learn ethics.pdf
How and when do we learn ethicsHow and when do we learn ethics.pdfaroraenterprisesmbd
 
How does a dominant culture differ from a subculture In your answer.pdf
How does a dominant culture differ from a subculture In your answer.pdfHow does a dominant culture differ from a subculture In your answer.pdf
How does a dominant culture differ from a subculture In your answer.pdfaroraenterprisesmbd
 
Help with implementing the four function the first is an exampleth.pdf
Help with implementing the four function the first is an exampleth.pdfHelp with implementing the four function the first is an exampleth.pdf
Help with implementing the four function the first is an exampleth.pdfaroraenterprisesmbd
 
Encrypt the message HALT by translating the letters into numbe.pdf
Encrypt the message  HALT  by translating the letters into numbe.pdfEncrypt the message  HALT  by translating the letters into numbe.pdf
Encrypt the message HALT by translating the letters into numbe.pdfaroraenterprisesmbd
 
Each letter in the word Massachusetts is written on a card. The card.pdf
Each letter in the word Massachusetts is written on a card. The card.pdfEach letter in the word Massachusetts is written on a card. The card.pdf
Each letter in the word Massachusetts is written on a card. The card.pdfaroraenterprisesmbd
 
Below is the question I need help with. It need to be done in Java. .pdf
Below is the question I need help with. It need to be done in Java. .pdfBelow is the question I need help with. It need to be done in Java. .pdf
Below is the question I need help with. It need to be done in Java. .pdfaroraenterprisesmbd
 
Css code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdfCss code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdfaroraenterprisesmbd
 
Case study Job Satisfaction in the Banking Industry Or the logisti.pdf
Case study Job Satisfaction in the Banking Industry Or the logisti.pdfCase study Job Satisfaction in the Banking Industry Or the logisti.pdf
Case study Job Satisfaction in the Banking Industry Or the logisti.pdfaroraenterprisesmbd
 
You are constructing working models of the heart for extra credit You.pdf
You are constructing working models of the heart for extra credit You.pdfYou are constructing working models of the heart for extra credit You.pdf
You are constructing working models of the heart for extra credit You.pdfaroraenterprisesmbd
 
why does countercurrent flow yields greater oxygen uptake than concu.pdf
why does countercurrent flow yields greater oxygen uptake than concu.pdfwhy does countercurrent flow yields greater oxygen uptake than concu.pdf
why does countercurrent flow yields greater oxygen uptake than concu.pdfaroraenterprisesmbd
 
Wind Shear can be defined in the horizontal plane as well as the vert.pdf
Wind Shear can be defined in the horizontal plane as well as the vert.pdfWind Shear can be defined in the horizontal plane as well as the vert.pdf
Wind Shear can be defined in the horizontal plane as well as the vert.pdfaroraenterprisesmbd
 
While hiking on some small islands in Lake Superior, you stumble acr.pdf
While hiking on some small islands in Lake Superior, you stumble acr.pdfWhile hiking on some small islands in Lake Superior, you stumble acr.pdf
While hiking on some small islands in Lake Superior, you stumble acr.pdfaroraenterprisesmbd
 
Which phyla have megaphylls Bryophyta Monilophyta Coniferophyta .pdf
Which phyla have megaphylls  Bryophyta  Monilophyta  Coniferophyta  .pdfWhich phyla have megaphylls  Bryophyta  Monilophyta  Coniferophyta  .pdf
Which phyla have megaphylls Bryophyta Monilophyta Coniferophyta .pdfaroraenterprisesmbd
 
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdf
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdfWhere do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdf
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdfaroraenterprisesmbd
 

More from aroraenterprisesmbd (20)

In the following list, which term is least related to the others tr.pdf
In the following list, which term is least related to the others  tr.pdfIn the following list, which term is least related to the others  tr.pdf
In the following list, which term is least related to the others tr.pdf
 
If your organization is going to apply for a grant, when do you thin.pdf
If your organization is going to apply for a grant, when do you thin.pdfIf your organization is going to apply for a grant, when do you thin.pdf
If your organization is going to apply for a grant, when do you thin.pdf
 
If the characteristic followed in the pedigree is x-linked recessive .pdf
If the characteristic followed in the pedigree is x-linked recessive .pdfIf the characteristic followed in the pedigree is x-linked recessive .pdf
If the characteristic followed in the pedigree is x-linked recessive .pdf
 
I want to know the purpose of parting lineSolutionA parting li.pdf
I want to know the purpose of parting lineSolutionA parting li.pdfI want to know the purpose of parting lineSolutionA parting li.pdf
I want to know the purpose of parting lineSolutionA parting li.pdf
 
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdf
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdfHTML5 & JqueryJavascriptI am trying to code a image slider and I.pdf
HTML5 & JqueryJavascriptI am trying to code a image slider and I.pdf
 
How to access this window in ANSYS (Picture 1 contains analysis s.pdf
How to access this window in ANSYS (Picture 1 contains analysis s.pdfHow to access this window in ANSYS (Picture 1 contains analysis s.pdf
How to access this window in ANSYS (Picture 1 contains analysis s.pdf
 
How and when do we learn ethicsHow and when do we learn ethics.pdf
How and when do we learn ethicsHow and when do we learn ethics.pdfHow and when do we learn ethicsHow and when do we learn ethics.pdf
How and when do we learn ethicsHow and when do we learn ethics.pdf
 
How does a dominant culture differ from a subculture In your answer.pdf
How does a dominant culture differ from a subculture In your answer.pdfHow does a dominant culture differ from a subculture In your answer.pdf
How does a dominant culture differ from a subculture In your answer.pdf
 
Help with implementing the four function the first is an exampleth.pdf
Help with implementing the four function the first is an exampleth.pdfHelp with implementing the four function the first is an exampleth.pdf
Help with implementing the four function the first is an exampleth.pdf
 
Encrypt the message HALT by translating the letters into numbe.pdf
Encrypt the message  HALT  by translating the letters into numbe.pdfEncrypt the message  HALT  by translating the letters into numbe.pdf
Encrypt the message HALT by translating the letters into numbe.pdf
 
Each letter in the word Massachusetts is written on a card. The card.pdf
Each letter in the word Massachusetts is written on a card. The card.pdfEach letter in the word Massachusetts is written on a card. The card.pdf
Each letter in the word Massachusetts is written on a card. The card.pdf
 
Below is the question I need help with. It need to be done in Java. .pdf
Below is the question I need help with. It need to be done in Java. .pdfBelow is the question I need help with. It need to be done in Java. .pdf
Below is the question I need help with. It need to be done in Java. .pdf
 
Css code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdfCss code for a awoko newspaper html website which provides busines.pdf
Css code for a awoko newspaper html website which provides busines.pdf
 
Case study Job Satisfaction in the Banking Industry Or the logisti.pdf
Case study Job Satisfaction in the Banking Industry Or the logisti.pdfCase study Job Satisfaction in the Banking Industry Or the logisti.pdf
Case study Job Satisfaction in the Banking Industry Or the logisti.pdf
 
You are constructing working models of the heart for extra credit You.pdf
You are constructing working models of the heart for extra credit You.pdfYou are constructing working models of the heart for extra credit You.pdf
You are constructing working models of the heart for extra credit You.pdf
 
why does countercurrent flow yields greater oxygen uptake than concu.pdf
why does countercurrent flow yields greater oxygen uptake than concu.pdfwhy does countercurrent flow yields greater oxygen uptake than concu.pdf
why does countercurrent flow yields greater oxygen uptake than concu.pdf
 
Wind Shear can be defined in the horizontal plane as well as the vert.pdf
Wind Shear can be defined in the horizontal plane as well as the vert.pdfWind Shear can be defined in the horizontal plane as well as the vert.pdf
Wind Shear can be defined in the horizontal plane as well as the vert.pdf
 
While hiking on some small islands in Lake Superior, you stumble acr.pdf
While hiking on some small islands in Lake Superior, you stumble acr.pdfWhile hiking on some small islands in Lake Superior, you stumble acr.pdf
While hiking on some small islands in Lake Superior, you stumble acr.pdf
 
Which phyla have megaphylls Bryophyta Monilophyta Coniferophyta .pdf
Which phyla have megaphylls  Bryophyta  Monilophyta  Coniferophyta  .pdfWhich phyla have megaphylls  Bryophyta  Monilophyta  Coniferophyta  .pdf
Which phyla have megaphylls Bryophyta Monilophyta Coniferophyta .pdf
 
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdf
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdfWhere do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdf
Where do endocyotic vesicles come fromA. Plasma membranceB. Nuc.pdf
 

Recently uploaded

Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsKarinaGenton
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 

Recently uploaded (20)

Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
Science 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its CharacteristicsScience 7 - LAND and SEA BREEZE and its Characteristics
Science 7 - LAND and SEA BREEZE and its Characteristics
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 

All based on Zybooks = AP Java with zylabsQUESTION 1char[][] tab.pdf

  • 1. All based on Zybooks = AP Java with zylabs QUESTION 1 char[][] table = new char[10][5]; How many rows are in the array seen in the accompanying figure? 0 5 10 15 QUESTION 2 The standard output object in Java is ____. output System.out Sys.out System.in QUESTION 3 The length of the string "first java program" is: 16 18 19 20 1 points QUESTION 4 The loop condition of a while loop is reevaluated before every iteration of the loop. True False 1 points QUESTION 5 If str1 is “Hello” and str2 is “Hi”, which of the following could not be a result of str1.compareTo(str2);? -9 -5 -1 1 1 points
  • 2. QUESTION 6 Both System.out.println and System.out.print can be used to output a string on the standard output device. True False 1 points QUESTION 7 In a method call statement, when passing an array as an actual parameter, you use only its name. True False 1 points QUESTION 8 Which of the following is true about a while loop? The body of the loop is executed at least once. The logical expression controlling the loop is evaluated before the loop is entered and after the loop exists. The body of the loop may not execute at all. It is a post-test loop 1 points QUESTION 9 int x, y; if (x < 4) y = 2; else if (x > 4) { if (x > 7) y = 4; else y = 6; } else y = 8; Based on the code above, what is the value of y if x = 9? 2
  • 3. 4 6 8 1 points QUESTION 10 The array index can be any nonnegative integer less than the array size. True False 1 points QUESTION 11 When a program executes, the first statement to execute is always the first statement in the main method. True False 1 points QUESTION 12 Java stores two-dimensional arrays in a row order form in computer memory. True False 1 points QUESTION 13 The statement dataType[][][] arrayName; would declare a two-dimensional array. True False 1 points QUESTION 14 All the methods defined in a class must have different names. True False 1 points QUESTION 15 Which of the following is NOT a reserved word in Java? double throws static num
  • 4. 1 points QUESTION 16 Given the declaration int[] list = new int[50]; the statement System.out.println(list[0] + "..." + list[49]); outputs all 50 components of the array list. True False 1 points QUESTION 17 In the case of an infinite while loop, the while expression (that is, the loop condition) is always true. True False 1 points QUESTION 18 Consider the following program. public class CircleArea { static Scanner console = new Scanner(System.in); static final double PI = 3.14; public static void main(String[]args) { doubler; double area; r = console.nextDouble(); area = PI * r * r; System.out.println("Area = " + area); }
  • 5. } To successfully compile this program, which of the following import statement is required? import java.io.Scanner; import java.util.Scanner; import java.lang.Scanner; No import statement is required 1 points QUESTION 19 An identifier can be any sequence of characters and integers. True False 1 points QUESTION 20 A single array can hold elements of many different data types. True False 1 points QUESTION 21 Consider the following program. // Insertion Point 1 public class CircleArea { // Insertion Point 2 static final float PI = 3.14 public static void main(String[]args) { //Insertion Point 3 float r = 2.0; float area; area = PI * r * r; System.out.println("Area = " + area); }
  • 6. // Insertion Point 4 } In the above code, where do the import statements belong? Insertion Point 1 Insertion Point 2 Insertion Point 3 Insertion Point 4 1 points QUESTION 22 Suppose that x is an int variable. Which of the following expressions always evaluates to false? (x > 0) || (x <= 0) (x > 0) || (x == 0) (x > 0) && ( x <= 0) (x >= 0) && (x == 0) 1 points QUESTION 23 What is the value of alpha[4] after the following code executes? int[] alpha = new int[5]; for (int j = 0; j < 5; j++) alpha[j] = 2 * j - 1; one three five seven 1 points QUESTION 24 If a = 4; and b = 3;, then after the statement a = b; executes, the value of b is 4 and the value of a is 3. True False 1 points QUESTION 25 The expression !(x <= 0) is true only if x is a positive number.
  • 7. True False 1 points QUESTION 26 In a return method, the last line of the method must be a return statement. True False 1 points QUESTION 27 The expression (int)8.7 evaluates to ____. 8 8.0 9.0 9 1 points QUESTION 28 A loop is a control structure that causes certain statements to be executed over and over until certain conditions are met. True False 1 points QUESTION 29 What is stored in alpha after the following code executes? int[] alpha = new int[5]; for (int j = 0; j < 5; j++) { alpha[j] = 2 * j; if (j % 2 == 1) alpha[j - 1] = alpha[j] + j; } alpha = {0, 2, 4, 6, 8} alpha = {3, 2, 9, 6, 8} alpha = {0, 3, 4, 7, 8}
  • 8. alpha = {0, 2, 9, 6, 8} 1 points QUESTION 30 Suppose that x and y are int variables and x = 7 and y = 8. After the statement: x = x * y - 2; executes, the value of x is ____. 42 54 56 58 1 points QUESTION 31 A counter-controlled loop should be used when the programmer knows the exact number of loop iterations are needed. True False 1 points QUESTION 32 In Java, a period is used to terminate a statement. True False 1 points QUESTION 33 In Java, return is a reserved word. True False 1 points QUESTION 34 When an array reference is passed to a method, the method can modify the elements of the array object. True False 1 points QUESTION 35 A local identifier is an identifier that is declared within a method or block and that is visible only within that method or block. True
  • 9. False 1 points QUESTION 36 An expression such as str.length(); is an example of a(n) ____. system call object call class method call 1 points QUESTION 37 Suppose str1 and str2 are String variables. The expression (str1 == str2) determines whether str1 and str2 reference the same String object. True False 1 points QUESTION 38 Just like the nesting of loops, Java allows the nesting of methods. True False 1 points QUESTION 39 Suppose console is a Scanner object initialized with the standard input device. The expression console.nextInt(); is used to read one int value and the expression console.nextDouble(); is used to read two int values. True False 1 points QUESTION 40 A compiler translates the assembly language instructions into machine language. True False 1 points QUESTION 41 An identifier can be declared anywhere including within a class, and outside of every method definition (and every block). True
  • 10. False 1 points QUESTION 42 The following for loop executes 21 times. (Assume all variables are properly declared.) for (i = 1; i <= 20; i = i + 1) System.out.println(i); True False 1 points QUESTION 43 Which of the following is the array subscripting operator in Java? . {} new [] 1 points QUESTION 44 char[][] table = new char[10][5]; How many columns are in the array seen in the accompanying figure? 0 5 10 15 1 points QUESTION 45 The digit 0 or 1 is called a ____. bit bytecode Unicode hexcode 1 points QUESTION 46 The output of the following Java code is: Stoor. int count = 5; System.out.print("Sto");
  • 11. do { System.out.print('o'); count--; } while (count >= 5); System.out.println('r'); True False 1 points QUESTION 47 The expression (double)(5 + 4) evaluates to ____. 8 9 9.0 10.0 1 points QUESTION 48 In Java, !, &&, and || are called logical operators. True False 1 points QUESTION 49 int x, y; if (x < 4) y = 2; else if (x > 4) { if (x > 7) y = 4; else y = 6; }
  • 12. else y = 8; Based on the code above, what is the value of y if x = 4? 2 4 6 8 1 points QUESTION 50 What is the output of the following code? int count; int num = 2; for (count = 1; count < 2; count++) { num = num + 3; System.out.print(num + " "); } System.out.println(); 5 5 8 2 5 8 5 8 11 0 5 10 15 Solution Answer : QUESTION 1 char[][] table = new char[10][5];
  • 13. How many rows are in the array seen in the accompanying figure? Answer : 10 .................. QUESTION 2 The standard output object in Java is ____. Answer : System.out Explanation: In java System.out is the standard output object. ................ QUESTION 3 The length of the string "first java program" is: Answer : 18 Explanation : first java program 5+1+4+1+7=18 ............ QUESTION 4 The loop condition of a while loop is reevaluated before every iteration of the loop. True False Answer : True Explanation : Yes,it is true.The while loop is reevaluated before every iteration of the loop ................ QUESTION 6 Both System.out.println and System.out.print can be used to output a string on the standard output device. True False Answer : True ..........................
  • 14. QUESTION 15 Which of the following is NOT a reserved word in Java? Answer : num ................. QUESTION 47 The expression (double)(5 + 4) evaluates to ____. Answer : 9.0 Explanation : Double is floating point type so (double)(5+4)=9.0 ..................... QUESTION 50 What is the output of the following code? int count; int num = 2; for (count = 1; count < 2; count++) { num = num + 3; System.out.print(num + " "); } System.out.println(); Answer : 5 Explanation : int num = 2; for (count = 1; count < 2; count++) //1<2 T //2<2 F { num = num + 3; // 2+3 System.out.print(num + " "); //5 } System.out.println();