Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Java, it is legal to have multiple variables with the same name at different scope levels. When this happens, what is the order in
In Java, it is legal to have multiple variables with the same name at different scope levels. When this happens, what is the order in which Java chooses which of the variables to use?
Class or object attributes
Answer Question
Choose...
Local variables
Answer Question
Choose...
Method parameters
Answer Question
Choose...
Question
Not yet answered
Marked out of
Flag question
Question text
Assume a class, OOFClass, defines a constructor with no arguments. You are editing OOFClass, and you want to create a new constructor that reuses the existing constructor to do some of the work. How would you call that constructor?
Question Answer
a
super called as the first command in the old constructor
b
this called anywhere in the old constructor
c
super called anywhere in the new constructor
d
this called anywhere in the new constructor
e
this called as the first command in the old constructor
f
super called anywhere in the old constructor
g
this called as the first command in the new constructor
h
super called as the first command in the new constructor
Question
Not yet answered
Marked out of
Flag question
Question text
DESCRIPTION
Scanner keyboard new ScannerSystemin;
int number ;
number keyboard.nextInt;
while number
System.out.printlnHi there" ;
number number number;
QUESTION
How many times will the line containing Hi there" be output to screen when the above piece of code executes if the user inputs
Question Select one:
None of the other options
Question
Not yet answered
Marked out of
Flag question
Question text
if testMark
System.out.printI usually remember to work through the skills test bank!";
else if testMark
System.out.printI usually remember some of last week's lectures!";
else if testMark
System.out.printI usually remember to turn up to my lab!";
else
System.out.printI usually remember my password!";
Which of the following statements is output to screen if the value of the variable testMark is
Question Select one:
I usually remember some of last week's lectures!
I usually remember to work through the skills test bank!
I usually remember my password!
I usually remember to turn up to my lab!
Question
Not yet answered
Marked out of
Flag question
Question text
Select the true statement.
Question Select one:
a
'this' refers to the current method.
b
'this' can be used inside static class methods.
c
'this' can be used inside instance methods.
Question
Not yet answered
Marked out of
Flag question
Question text
Overloaded methods in a class have:
Question Answer
a
Same name and different signature
b
Same name but different return type
c
Different name but same signature
d
Same name and same signature
Question
Not yet answered
Marked out of
Flag question
Question text
Given the following Java code, what would be the result if was entered at the prompt? import java.util.; public class EchoInteger public static void mainString args Scanner keyboard new ScannerSystemin; System.out.printlnEnter an integer: ; int input keyboard.nextInt; System.out.printlnThe integer was input ;
Question Select one:
a
InputMismatchException
b
Print out "The integer was
c
Print out "The integer was
Question
Not yet answered
Marked out of
Flag question
Question text
What is the output of this program?
public class Thing
public int a;
public static void mainString args
Thing thing new Thing;
thinga ;
Thing thing new Thing;
thinga ;
Thing thing thing;
thinga thinga thinga;
System.out.printthinga;
Answer:Question
Question
Not yet answered
Marked out of
Flag question
Question text
Assume a is declared as int a ; What is the value of aalength
Question Answer
a
b
c
d
e
Nothing; an exception is thrown
Question
Not yet answered
Marked out of
Flag question
Question text
If the base type of an array is an object type, each element of the array holds
Question Answer
a
the actual value of that element
b
a reference to an object of that type
c
d
null
Question
Not yet answered
Marked out of
Flag question
Question text
A access modifier means that the attributemethod is accessible to all subclasses of the class.
Question Answer
a
Protected
b
Package
c
Public
d
Private
Question
Not yet answered
Marked out of
Flag question
Question text
Assume we have two variables declared as int a ; and int b ; What is the value of a b
Question Answer
a
true
b
false
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started