<< Chapter < Page Chapter >> Page >
This module contains review questions and answers keyed to the module titled Jb0190: Java OOP: Using the System and PrintStream Classes

Revised: Mon Mar 28 11:58:41 CDT 2016

This page is included in the following Books:

Table of contents

Preface

This module contains review questions and answers keyed to the module titled Jb0190: Java OOP: Using the System and PrintStream Classes .

The questions and the answers are connected by hyperlinks to make it easy for you to navigate from the question to the answer and back again.

Questions

Question 1 .

True or false? The main method in the controlling class of a Java application controls the flow of the program.

Answer 1

Question 2

True or false? The main method cannot access the variables and methods of objects instantiated from other classes.

Answer 2

Question 3

True or false? The main method must instantiate objects of other classes in order for the program to execute.

Answer 3

Question 4

True or false? In order to be useful, the System class must be used to instantiate objects in a Java application.

Answer 4

Question 5

True or false? Class variables such as the out variable of the System class must be of some specific type.

Answer 5

Question 6

True or false? Class variables must be of a primitive type such as int or float .

Answer 6

Question 7

True or false? The out variable in the System class is of a primitive type.

Answer 7

Question 8

What does the following code fragment access?

System.out

Answer 8

Question 9

True or false? An object of type PrintStream is automatically instantiated when the System class is loaded into an application.

Answer 9

Question 10

True or false? The out variable in the System class refers to an instance of what class?

Answer 10

Question 11

True or false? The println method is an instance method of what class?

Answer 11

Question 12

What is the primary behavior of the println method?

Answer 12

Question 13

How can the println method be accessed?

Answer 13

Question 14

Assuming that the standard output device has not been redirected, write a code fragment that will cause your name to be displayed onthe screen.

Answer 14

Question 15

Explain how your code fragment in Answer 14 produces the desired result.

Answer 15

Question 16

If you have a class named MyClass that has a class variable named myClassVariable that requires four bytes of memory and you instantiate ten objects of type MyClass , how much total memory will be allocated to contain the allocated variables (assume that the class definition contains no other class, instance, or local variables) .

Answer 16

Question 17

How many actual instances of the variable named out are allocated in memory by the following code fragment?

System.out.println("Dick Baldwin");

Answer 17

Question 18

If you have a class named MyClass that has an instance variable named myInstanceVariable that requires four bytes of memory and you instantiate ten objects of type MyClass , how much total memory will be allocated to contain the allocated variables (assume that the class definition contains no other class, instance, or local variables) .

Questions & Answers

participants in market
LEHLOGONOLO Reply
do the negative slope of production possibility curve sloped to show trade offs in production of two goods?
Bafokeng Reply
how is economics not a science subject
Adio Reply
i need the main definition of economics
Okafor Reply
according to professor Richard lipsey economics is a social science that concerns with the way society has employ scarce productive resources in other to achieve a certain conditions of living
Confidence
what does it mean to say that market equilibrium is stable?
Ayesha Reply
what is the practical significance of cross price elasticity of demand?
Ayesha
what is economic
Azolingo Reply
what is the practical significance of cross price elasticity of demand?
Ayesha
economics is a social science that deals with human behaviour relating with end and scares means
Okafor
according to working definition of economics by professor Richard lipsey economics is a social science that concerns with the way society has choice to employ scarce productive resources in other to achieve a certain living conditions
Confidence
why is economics not a pure science?
AHUMBE Reply
it is not a pure science because it only studies human behavior
Ayaane
economics is a social science cause it is relating to ends and scares means🙂
Okafor
economics is not a pure science because it studies about human behaviour scarcity want and needs of human beings and the critical thinking of human beings it can be said not to be a pure science because it cannot be manipulated because you don't know humans minds, humans minds are unpredictable
Confidence
economics is not a pure science because it studies about human behavior scarcity want and needs of human being .and the critical thinking of human being. last science can be manipulated but economics cannot because you don't know humans minds, humans min
Confidence
what is management of human resources?
Ibrahim Reply
how is economics a science?
Mei Reply
economics is not a science subject either is a social science subject
Okafor
hmmm what do u mean
Confidence
4. It is a hot day, and Bert is thirsty. Here is the value he places on each bottle of water: Value of first bottle $7 Value of second bottle $5 Value of third bottle $3 Value of fourth bottle $1 a. From this information, derive Bert’s demand schedule. Graph his demand curve for bottled w
Tahmina Reply
hello
Lukman
what is the law of diminishing marginal utility
Samuel Reply
The law of diminishing marginal utility state that as a consumer consumes a successive units of a commodity, a point is eventually reached where consumption of additional unit yields less satisfaction.
raheem
what is demand
Isatu Reply
other things can be equal an certain amount paid for the goods by consumer in the market called demand.
Dhanishhwar
demand is the amount of a commodity a consumer is willing and able buy at a given price at a particular point in time
Samuel
Demand is the quantity of commodity a consumer is willing and able to buy at a given price and a particular time.
raheem
demand can be defined as the willingness and ability of a consumer to purchase goods or services at a given price in a particular time
Confidence
what is economics
Owusu Reply
economics is a social science subject, which study human behaviors as a relationship btw end ND scarce means
Joseph
what utility
Isatu
Utility is the satisfaction a consumer derives from consuming a particular commodity.
raheem
meaning of economics
Agyei Reply
what is a columnist
Owusu
what are the four basic assumptions of perfect competition
Liyanda Reply
While the American heart association suggests that meditation might be used in conjunction with more traditional treatments as a way to manage hypertension
Beverly Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Object-oriented programming (oop) with java. OpenStax CNX. Jun 29, 2016 Download for free at https://legacy.cnx.org/content/col11441/1.201
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Object-oriented programming (oop) with java' conversation and receive update notifications?

Ask