All classes implement an abstract data type. - ANSWERFalse
In a single statement, define and initialize a reference variable for an ArrayList named frameScores that stores items of type Integer. - ANSWERArrayList frameScores = new ArrayList();
Given: ArrayList itemsList = new ArrayList(); Wha...
All classes implement an abstract data type. - ANSWERFalse
In a single statement, define and initialize a reference variable for an ArrayList named frameScores
that stores items of type Integer. - ANSWERArrayList frameScores = new ArrayList();
Given: ArrayList itemsList = new ArrayList(); What is the initial size of the ArrayList? - ANSWER0; Zero
The _________ operator is used to explicitly allocate an object. - ANSWERnew
Given: Employee clerk1 = new Employee() ;. clerk1 refer to an object. - ANSWERTrue
Define a private field named salary of type int for Employee class: - ANSWERprivate int salary;
Which of the following commands is used to run a java program? - ANSWERjava
The constructor has the same name as the class. The constructor method has no return type, not
even void. - ANSWERTrue
Class Dwelling has data members door1, door2, door3. A class House is derived from Dwelling and
has data members wVal, xVal, yVal, zVal. The definition and initialization House h = new House();
creates how many data members? - ANSWER7; seven
Using a JFormattedTextField variable named numItersField, write a statement that creates a
JFormattedTextField that uses a NumberFormat to display integers. - ANSWERnumItersField = new
JFormattedTextField(NumberFormat.getIntegerInstance());
The block tag specification below creates a reference to ElapsedTime's printTime() method. @see
ElapsedTime#printTime() - ANSWERTrue
,Given a JFrame variable named frame and a JTextField variable named nameField, write a statement
that adds nameField to the frame. - ANSWERframe.add(nameField);
Assume an empty JFrame object named appFrame. The program called the setVisible() method
correctly (i.e., appFrame.setVisible(true);), but the frame is not visible on the screen. The frame
should be 500 pixels wide and 300 pixels tall. - ANSWERappFrame.setSize(500, 300);
Which of the following is NOT a characteristics of Object Oriented Programming? -
ANSWERrevolution
Using the GridBagConstraints variable named layoutConstraints, write a statement that would add 5
pixels of padding to the left and right of a GUI component. The top and bottom edges of the
component should not have padding. - ANSWERlayoutConstraints.insets = new Insets(0, 5, 0, 5);
Given the JTextField variable named weeklyHoursField, write a statement that makes
weeklyHoursField editable by users. - ANSWERweeklyHoursField.setEditable(true);
A private helper method may not call another private helper method. - ANSWERFalse
Which access modifier allows a class be used by every class in the program regardless of the package
in which either is defined? - ANSWERpublic
Suppose your program uses an object called Student. Which of the following shall NOT be part of the
Student object? - ANSWERgetPrice()
By default, the equals() method tests the equality of the contents of two Objects , not the equality of
their references. - ANSWERFalse
Suppose that public Student(String name, String id){// code} is the only constructor the Student class
has. Which of the following is correct? - ANSWERStudent s = new Student(â Tomâ , â 1234â );
A derived class may define a member method having the same name as the base class. Such a
member method _______________ the method of the base class. - ANSWERoverrides
Suppose that we have the following code. Student s1 = new Student(); Student s2; Which of the
following is true after the above two line of code are executed? - ANSWERs1 refers to valid object
, Instances of primitive wrapper classes, such as Integer and Double, and the String class are defined
as immutable, meaning that a programmer cannot modify the object's contents after initialization;
new objects must be created instead. - ANSWERTrue
A mutator should not change a class' private data. - ANSWERFalse
The process of creating and running a program that tests a specific item (or "unit"), such as a method
or a class, is known as ________ testing. - ANSWERunit
In Student class, there is a field double gpa; and a method void setGpa(double gpa); In main()
function, given variable definition Student s = new Student(); which of the following code set the sâ
gap to be 3.5? - ANSWERs.setGpa(3.5);
There is exactly one way to decompose a program into classes. - ANSWERFalse
The ____________ data type is a built-in class in Java that augments the int primitive type. -
ANSWERInteger
Write a statement that assigns the double representation of the value held by the Integer objects
numElements to a double variable named calcSize. - ANSWERcalcSize = numElements.doubleValue();
Each item in array is directly accessible - ANSWERTrue
Given array firstList with size 4 and element values, 33, 44, 55, 66, and array secondList with size 4
and elements values 0, 0, 0, 0. Consider loop for (i = 0; i < 4;
++i) { secondList[i] = firstList[i];}. After execution of the above loop, code secondList[2] = 100; will
modify firstList[2] to be 100 too. - ANSWERFalse
What is the index of the last element in an array? - ANSWERThe size of the array minus one.
A continue statement in a loop causes an immediate exit of the loop. - ANSWERFalse
Voordelen van het kopen van samenvattingen bij Stuvia op een rij:
Verzekerd van kwaliteit door reviews
Stuvia-klanten hebben meer dan 700.000 samenvattingen beoordeeld. Zo weet je zeker dat je de beste documenten koopt!
Snel en makkelijk kopen
Je betaalt supersnel en eenmalig met iDeal, creditcard of Stuvia-tegoed voor de samenvatting. Zonder lidmaatschap.
Focus op de essentie
Samenvattingen worden geschreven voor en door anderen. Daarom zijn de samenvattingen altijd betrouwbaar en actueel. Zo kom je snel tot de kern!
Veelgestelde vragen
Wat krijg ik als ik dit document koop?
Je krijgt een PDF, die direct beschikbaar is na je aankoop. Het gekochte document is altijd, overal en oneindig toegankelijk via je profiel.
Tevredenheidsgarantie: hoe werkt dat?
Onze tevredenheidsgarantie zorgt ervoor dat je altijd een studiedocument vindt dat goed bij je past. Je vult een formulier in en onze klantenservice regelt de rest.
Van wie koop ik deze samenvatting?
Stuvia is een marktplaats, je koop dit document dus niet van ons, maar van verkoper papersmaster01. Stuvia faciliteert de betaling aan de verkoper.
Zit ik meteen vast aan een abonnement?
Nee, je koopt alleen deze samenvatting voor €16,02. Je zit daarna nergens aan vast.