<< Chapter < Page Chapter >> Page >

Answer 10

Question 11

True or False? The execution of a Java application begins and ends in the method named main .

Answer 11

Question 12

True or False? The two commands shown in Listing 4 can be used to compile and execute a Java application named Prob01 where:

  • The only special class library required is contained in the folder named bookClasses .
  • The path from the root to the folder named bookClasses is represented by ---\bookClasses.
Listing 4 . Question 12.
javac -cp .;---\bookClasses Prob01.java java -cp .;---\bookClasses Prob01

Answer 12

Question 13

True or False? The Java compiler program is named java.exe .

Answer 13

Question 14

True or False? The Prob01.java and Prob01 at the ends of the two commands in Listing 4 specify the files being operated on by the virtual machine and the compilerrespectively.

Answer 14

Question 15

True or False? In Listing 4 , the -cp indicates that a classpath follows.

Answer 15

Question 16

True or False? A classpath consists of one or more path specifications separated by semicolon characters.

Answer 16

Question 17

True or False? The purpose of the classpath in Listing 4 is to tell the compiler and the virtual machine where to look for source codefiles that the application needs in order to successfully compile and execute.

Answer 17

Question 18

True or False? The period ahead of the semicolon in Listing 4 says to search the root folder first.

Answer 18

Question 19

True or False? The first statement in the body of the main method in Listing 1 instantiates a new object of the class named Prob01Runner .

Answer 19

Question 20

True or False? The first statement in Listing 1 saves a reference to a new object of the class named Prob01Runner in a reference variable named obj . In general, the type of the variable must be:

  • The name of the object, or
  • The name of a superclass of the object, or
  • The name of an interface implemented by the object.

Answer 20

Question 21

True or False? In Java, you must save a reference to a newly instantiated object in order to gain access to that object later in the program.

Answer 21

Question 22

True or False? The second statement in the body of the main method in Listing 1 uses the reference stored in the variable named obj to call the method named run encapsulated in the object referred to by the contents of obj .

Answer 22

Question 23

True or False? The following three methods that are called in Listing 1 are of a type that is commonly referred to as accessor methods . They are also sometimes referred to by the slang term getter methods .

  • getMars
  • getJoe
  • getSue

Answer 23

Question 24

True or False? The method named println that is called in Listing 1 is a member of Ericson's multimedia library. The purpose of the println method is to display text on an image.

Answer 24

Question 25

True or False? Java uses four access modifiers to specify the accessibility of various classes and members in a Java application:

  • public
  • private
  • protected
  • package-private

Answer 25

Question 26

True or False? Listing 5 shows the beginning of a class named Prob01Runner .

Listing 5 . Question 26.
class Prob01Runner{ //Instantiate the World and Turtle objects.private World mars = new World(300,274); private Turtle joe = new Turtle(mars);private Turtle sue = new Turtle(mars);

Questions & Answers

what is mutation
Janga Reply
what is a cell
Sifune Reply
how is urine form
Sifune
what is antagonism?
mahase Reply
classification of plants, gymnosperm features.
Linsy Reply
what is the features of gymnosperm
Linsy
how many types of solid did we have
Samuel Reply
what is an ionic bond
Samuel
What is Atoms
Daprince Reply
what is fallopian tube
Merolyn
what is bladder
Merolyn
what's bulbourethral gland
Eduek Reply
urine is formed in the nephron of the renal medulla in the kidney. It starts from filtration, then selective reabsorption and finally secretion
onuoha Reply
State the evolution relation and relevance between endoplasmic reticulum and cytoskeleton as it relates to cell.
Jeremiah
what is heart
Konadu Reply
how is urine formed in human
Konadu
how is urine formed in human
Rahma
what is the diference between a cavity and a canal
Pelagie Reply
what is the causative agent of malaria
Diamond
malaria is caused by an insect called mosquito.
Naomi
Malaria is cause by female anopheles mosquito
Isaac
Malaria is caused by plasmodium Female anopheles mosquitoe is d carrier
Olalekan
a canal is more needed in a root but a cavity is a bad effect
Commander
what are pathogens
Don Reply
In biology, a pathogen (Greek: πάθος pathos "suffering", "passion" and -γενής -genēs "producer of") in the oldest and broadest sense, is anything that can produce disease. A pathogen may also be referred to as an infectious agent, or simply a germ. The term pathogen came into use in the 1880s.[1][2
Zainab
A virus
Commander
Definition of respiration
Muhsin Reply
respiration is the process in which we breath in oxygen and breath out carbon dioxide
Achor
how are lungs work
Commander
where does digestion begins
Achiri Reply
in the mouth
EZEKIEL
what are the functions of follicle stimulating harmones?
Rashima Reply
stimulates the follicle to release the mature ovum into the oviduct
Davonte
what are the functions of Endocrine and pituitary gland
Chinaza
endocrine secrete hormone and regulate body process
Achor
while pituitary gland is an example of endocrine system and it's found in the Brain
Achor
what's biology?
Egbodo Reply
Biology is the study of living organisms, divided into many specialized field that cover their morphology, physiology,anatomy, behaviour,origin and distribution.
Lisah
biology is the study of life.
Alfreda
Biology is the study of how living organisms live and survive in a specific environment
Sifune
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