Level 34 Level 36
Level 35

[Quiz] Basic Syntax III


86 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
if
Without braces, the compiler always associates an else with the nearest _______ above it.
implements
What keyword at the beginning of a class groups with an interface?
import
A Java programming language keyword used at the beginning of a source file that can specify classes or entire packages to be referred to later without including their package names in the reference.
instanceof
Tests to see whether a certain object comes from a certain class.
interface
What is a group of related methods with empty bodies?
native
Enables the programmer to use code that was written in another language (one of those awful languages other than Java).
new
Which operator creates objects?
private
In the spirit of encapsulation, it is common to make fields _______ .
protected
Wich access modifier has acces to a: class, Package, subclass
return
Ends execution of a method and possibly returns a value to the calling code.
short
16 bits long. 16 bit integer (-32K - 32K)
static
Indicates that a variable or method belongs to a class, rather than to any object created from the class.
super
Similar to the "this" keyword you can use the _______ keyword to refer directly to a superclass
switch
Tells the computer to follow one of many possible paths of execution (one of many possible cases), depending on the value of an expression.
synchronized
Keeps two threads from interfering with one another.
this
Keyword used in the body of a method definition when you need to refer to the object to which the method belongs.
throw
Creates a new exception object and indicates that an exceptional situation (usually something unwanted) has occurred.
throws
Indicates that a method or constructor may pass the buck when an exception is thrown.
transient
Indicates that, if and when an object is serialized, a variable's value doesn't need to be stored.
try
Introduces statements that are watched (during runtime) for things that can go wrong.
void
Every method should have a return type. If it doesn't return anything what is the return type?
while
Repeats some statements over and over again (as long as a condition is still true).
Instance variable
class Test {
non-static fields
The term 'instance variable' is another name for
Class variable
What kind of variable is this?
local variables
a method will often store its temporary state in what kind of variables?
parameters
public static void main(int hello, String name){}
variables, fields
The important thing to remember is that parameters are always classified as _______ not _______
fields
And object stores it states in _______.
local variables, parameters.
If we are talking about "fields in general" (excluding _______ and _______), we may simply say "fields"
members.
A type's fields, methods, and nested types are collectively called its _______
fields, methods, nested types
A type's _______, _______, and _______ are collectively called its members.
Yes
is wakingto a good methodname?
No
is sixmiles a good methodname?
-128, 127,
The byte data type is an 8-bit signed two's complement integer. It has a minimum value of _______ and a maximum value of _______ (inclusive).
large arrays, int, code
The byte data type can be useful for saving memory in _______, where the memory savings actually matters. They can also be used in place of __where their limits help to clarify your __;…
cannot
signed intigers can/cannot negative numbers.
can
Assignment of PLSQL_CCFLAGS (cannot / can) be included in ALTER PROCEDURE ... COMPILE ...
intergral values
For _______ int is generally the default choice unless there is a reason to choose something else.
primitive datatypes
byte, short, bool, etc are called:
long
64 bits long 64 bit intiger
-2.147.483.648, 2.147.483.647
It has a minimum value of _______ and a maximum value of _______ (inclusive).
-9.223.372.036.854.775.808, 9.223.372.036.854.775.807
The long data type is a 64-bit signed two's complement integer. It has a minimum value of _______ and a maximum value of _______ (inclusive).
precise values
Float should never be used for _______, such as currency.
currency
Float should never be used for precise values, such as _______
java.math.BigDecimal
For currency you will need to use the (class):
'', '\uffff'
The char data type is a single 16-bit Unicode character. It has a minimum value of _______ (or 0) and a maximum value of _______
immutable
String objects are _______, which means that once created, their values cannot be changed.
0
When you do not assign a value to byte it's default is:
0L
When you do not assign a value to long it's default is:
0.0f
When you do not assign a value to float it's default is:
0.0d
When you do not assign a value to double it's default is:
''
When you do not assign a value to char it's default is:
null
What is the default field of the String type?
false
True or false: the else clause is required.
compile-time error
an error that is detected when a program is compiled
0X, 0b
The prefix __ indicates hexadecimal and __indicates binary
\b
escape sequences for: backspace
\t
escape sequences for: tab
\n
escape sequences for: line feed
\f
escape sequences for: form feed
\r
escape sequences for: carriage return
\'
Single Quote
\\
escape sequences for: backslash
Unicode
A standardized 16-bit character set that represents the character sets of most major languages in the world. The letters entered have to be above 192.
string literal
\'
int hello = 1234_5678_901_3456L;
int hello = 1234.5678.9012.3456L;
int[] anArray;
declare a array of intigers:
String[] anArray;
declare a array of strings called anArray.
Boolean[] anArray;
declare a array of booleans
byte[] Array1;
declare an Array Of Bytes called Array1;
short[] Array1;
declare an Array Of Shorts called Array1;
long[] Array1;
declare an Array Of longscalled Array1;
float[] Array1;
declare an Array Of floats called Array1;
double[] Array1;
declare an Array Of doubles called Array1;
boolean[] Array1;
declare an Array Of booleans called Array1;
char[] Array1;
declare an Array Of chars called Array1;
String[] Array1;
an Array Of strings called Array1;
int[] anArray = {100};
Use the shortcut syntax to create and initialize an intiger array called "anArray" and store 100.
String[] anArray = {"string1"};
Use the shortcut syntax to create and initialize an intiger array called "anArray" and store "string1".
multidimensional
You can also declare an array of arrays (also known as a _______ array
{"Smith", "Jones"} };
String[][] names = {{"Mr. ", "Mrs. ", "Ms. "},
anArray.length
get the length of an array called anArray;
System.arraycopy(copyFrom, 2, copyTo, 0, 7);
public static void main(String[] args) {
System.out.println(new String(copyTo));
public static void main(String[] args) {
result = someCondition ? value1 : value2;
Another conditional operator is ?:, which can be thought of as shorthand for an if-then-else statement.