<< Chapter < Page Chapter >> Page >
This module contains review questions and answers keyed to the module titled Java3010: Indirection, Array Objects, and Casting.

Revised: Sun Apr 03 10:26:37 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 Java3010: Indirection, Array Objects, and Casting .

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 code shown in Listing 1 produces the output shown in Figure 1 where the numeric values are random and vary from one run to the next.

Listing 1 . Question 1.
/*File Java3010ra Copyright 2013, R.G.Baldwin Rev 02/14/13*********************************************************/ import java.util.*;class Java3010ra{ public static void main(String[]args){ Random generator = new Random(new Date().getTime());int randomNumber = (byte)generator.nextInt(); Object[]objRef = [new Java3010raMyClassA(randomNumber)];System.out.println( new Java3010raMyClassB().getDataFromObj(objRef[0]));System.out.println(randomNumber); }//end main}//end class Java3010ra //======================================================//class Java3010raMyClassA extends Java3010ra{ private int data;public Java3010raMyClassA(int inData){ System.out.println("Java3010ra");System.out.println("Dick"); data = inData;}//end constructor public int getData(){return data; }//end getData()}//end class Java3010raMyClassA //======================================================//class Java3010raMyClassB{ Java3010raMyClassB(){System.out.println("Baldwin"); }//end constructorpublic int getDataFromObj(Object refToObj){ return ((Java3010raMyClassA)refToObj).getData();}//end getDataFromObj() }//end class Java3010raMyClassB
Figure 1 . Question 1.
Java3010ra DickBaldwin -37-37

Answer 1

Question 2

True or False? All array objects in Java contain one-dimensional array structures.

Answer 2

Question 3

True or False? Each array in Java is encapsulated in an array object. An array object must be accessed using a reference to the array object.

Answer 3

Question 4

True or False? When the declared type of an array is one of the eight primitive types, the actual values are stored in the array elements in the array object.

Answer 4

Question 5

True or False? When the declared type of an array is the type of an object (array object or ordinary object) , those objects are stored in the array elements.

Answer 5

Question 6

True or False? Unless code is written to do otherwise, the elements in a new array object are initialized with the standard default values for the types involved (zero, true, or null) .

Answer 6

Question 7

True or False? The array structure that is encapsulated in an array object must have one, or more elements.

Questions & Answers

if theta =30degree so COS2 theta = 1- 10 square theta upon 1 + tan squared theta
Martin Reply
how to compute this 1. g(1-x) 2. f(x-2) 3. g (-x-/5) 4. f (x)- g (x)
Yanah Reply
hi
John
hi
Grace
what sup friend
John
not much For functions, there are two conditions for a function to be the inverse function:   1--- g(f(x)) = x for all x in the domain of f     2---f(g(x)) = x for all x in the domain of g Notice in both cases you will get back to the  element that you started with, namely, x.
Grace
sin theta=3/4.prove that sec square theta barabar 1 + tan square theta by cosec square theta minus cos square theta
Umesh Reply
acha se dhek ke bata sin theta ke value
Ajay
sin theta ke ja gha sin square theta hoga
Ajay
I want to know trigonometry but I can't understand it anyone who can help
Siyabonga Reply
Yh
Idowu
which part of trig?
Nyemba
functions
Siyabonga
trigonometry
Ganapathi
differentiation doubhts
Ganapathi
hi
Ganapathi
hello
Brittany
Prove that 4sin50-3tan 50=1
Sudip Reply
f(x)= 1 x    f(x)=1x  is shifted down 4 units and to the right 3 units.
Sebit Reply
f (x) = −3x + 5 and g (x) = x − 5 /−3
Sebit
what are real numbers
Marty Reply
I want to know partial fraction Decomposition.
Adama Reply
classes of function in mathematics
Yazidu Reply
divide y2_8y2+5y2/y2
Sumanth Reply
wish i knew calculus to understand what's going on 🙂
Dashawn Reply
@dashawn ... in simple terms, a derivative is the tangent line of the function. which gives the rate of change at that instant. to calculate. given f(x)==ax^n. then f'(x)=n*ax^n-1 . hope that help.
Christopher
thanks bro
Dashawn
maybe when i start calculus in a few months i won't be that lost 😎
Dashawn
what's the derivative of 4x^6
Axmed Reply
24x^5
James
10x
Axmed
24X^5
Taieb
Thanks for this helpfull app
Axmed Reply
secA+tanA=2√5,sinA=?
richa Reply
tan2a+tan2a=√3
Rahulkumar
classes of function
Yazidu
if sinx°=sin@, then @ is - ?
NAVJIT Reply
the value of tan15°•tan20°•tan70°•tan75° -
NAVJIT
what's the easiest and fastest way to the synthesize AgNP?
Damian Reply
China
Cied
types of nano material
abeetha Reply
I start with an easy one. carbon nanotubes woven into a long filament like a string
Porter
many many of nanotubes
Porter
what is the k.e before it land
Yasmin
what is the function of carbon nanotubes?
Cesar
I'm interested in nanotube
Uday
what is nanomaterials​ and their applications of sensors.
Ramkumar Reply
what is nano technology
Sravani Reply
what is system testing?
AMJAD
preparation of nanomaterial
Victor Reply
Yes, Nanotechnology has a very fast field of applications and their is always something new to do with it...
Himanshu Reply
good afternoon madam
AMJAD
what is system testing
AMJAD
what is the application of nanotechnology?
Stotaw
In this morden time nanotechnology used in many field . 1-Electronics-manufacturad IC ,RAM,MRAM,solar panel etc 2-Helth and Medical-Nanomedicine,Drug Dilivery for cancer treatment etc 3- Atomobile -MEMS, Coating on car etc. and may other field for details you can check at Google
Azam
anybody can imagine what will be happen after 100 years from now in nano tech world
Prasenjit
after 100 year this will be not nanotechnology maybe this technology name will be change . maybe aftet 100 year . we work on electron lable practically about its properties and behaviour by the different instruments
Azam
name doesn't matter , whatever it will be change... I'm taking about effect on circumstances of the microscopic world
Prasenjit
how hard could it be to apply nanotechnology against viral infections such HIV or Ebola?
Damian
silver nanoparticles could handle the job?
Damian
not now but maybe in future only AgNP maybe any other nanomaterials
Azam
Hello
Uday
I'm interested in Nanotube
Uday
this technology will not going on for the long time , so I'm thinking about femtotechnology 10^-15
Prasenjit
can nanotechnology change the direction of the face of the world
Prasenjit Reply
At high concentrations (>0.01 M), the relation between absorptivity coefficient and absorbance is no longer linear. This is due to the electrostatic interactions between the quantum dots in close proximity. If the concentration of the solution is high, another effect that is seen is the scattering of light from the large number of quantum dots. This assumption only works at low concentrations of the analyte. Presence of stray light.
Ali Reply
the Beer law works very well for dilute solutions but fails for very high concentrations. why?
bamidele Reply
Got questions? Join the online conversation and get instant answers!
QuizOver.com Reply

Get the best Algebra and trigonometry course in your pocket!





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