Docsity

Java Keywords and Their Definitions, Quizzes of Introduction to Business Management

Toggle sidebar
bg1
TERM 1
int
DEFINITION 1
definition:declares a variable as a primitive data type that
only allows integer, numerical valuesEx: private int. age;
TERM 2
abstract
DEFINITION 2
definition:used to declare a class or m ethod to beabstract.[3]An
abstract method has no implementa tion; all classes containing
abstract methods must themselves be abstract, although not all
abstract classes have abstract meth ods.Objectsof a class which is
abstract cannot beinstantiated, but can beextendedby other
classes. Allsubclassesof an abstract cl ass must either provide
implementations for all abstract met hods, or must also be abstract
TERM 3
assert
DEFINITION 3
used to make anassertiona statement which the programmer
believes is always true at that point in the program. If
assertions are enabled when the program is run and it turns
out that an assertion is false, anAssertionErroris thrown and
the program terminates. This keyword is intended to aid
indebugging
TERM 4
boolean
DEFINITION 4
used to declare a field that can store a boolean value that is
either true or false. also can be used to declare a method
that returns a primitive type boolean
TERM 5
break
DEFINITION 5
used to resume program execution at the statement
immediately following the current enclosing block statement.
If followed by a label, the program resumes execution at the
statement immediately following the enclosing labeled
statement or block
pf3
pf4
pf5

Partial preview of the text

Download Java Keywords and Their Definitions and more Quizzes Introduction to Business Management in PDF only on Docsity!

int

definition:declares a variable as a primitive data type that only allows integer, numerical valuesEx: private int. age; TERM 2

abstract

DEFINITION 2 definition:used to declare a class or method to beabstract.[3]An abstract method has no implementation; all classes containing abstract methods must themselves be abstract, although not all abstract classes have abstract methods.Objectsof a class which is abstract cannot beinstantiated, but can beextendedby other classes. Allsubclassesof an abstract class must either provide implementations for all abstract methods, or must also be abstract TERM 3

assert

DEFINITION 3 used to make anassertiona statement which the programmer believes is always true at that point in the program. If assertions are enabled when the program is run and it turns out that an assertion is false, anAssertionErroris thrown and the program terminates. This keyword is intended to aid indebugging TERM 4

boolean

DEFINITION 4 used to declare a field that can store a boolean value that is either true or false. also can be used to declare a method that returns a primitive type boolean TERM 5

break

DEFINITION 5 used to resume program execution at the statement immediately following the current enclosing block statement. If followed by a label, the program resumes execution at the statement immediately following the enclosing labeled statement or block

byte

used to declare a field that can store an 8-bit signed two's compliment integer. also used to declare a method of primitive type byte TERM 7

case

DEFINITION 7 used to create individual cases in a switch statement TERM 8

catch

DEFINITION 8 Defines anexception handlera group of statements that are executed if an exception is thrown in the block defined by a precedingtrykeyword. The code is executed only if the class of the thrown exception is assignment compatible with the exception class declared by thecatchclause. TERM 9

char

DEFINITION 9 Thecharkeyword is used to declare a field that can store a 16-bitUnicodecharacter.[7][8]This keyword is also used to declare that a method returns a value of the primitive typechar TERM 10

class

DEFINITION 10 A type that defines the implementation of a particular kind of object. A class definition definesinstanceand class fields,methods, andinner classesas well as specifying theinterfacesthe class implements and the immediatesuperclassof the class. If the superclass is not explicitly specified, the superclass is implicitlyObject

else

Theelsekeyword is used in conjunction withifto create anif- else statement, which tests aboolean expression; if the expression evaluates totrue, the block of statements associated with theifare evaluated; if it evaluates tofalse, the block of statements associated with theelseare evaluated TERM 17

enum

DEFINITION 17 A Java keyword used to declare anenumerated type. Enumerations extend the base classEnum TERM 18

extends

DEFINITION 18 Used in a class declaration to specify the superclass; used in an interface declaration to specify one or more superinterfaces. Class X extends class Y to add functionality, either by adding fields or methods to class Y, or by overriding methods of class Y. An interface Z extends one or more interfaces by adding methods. Class X is said to be a subclass of class Y; Interface Z is said to be a subinterface of the interfaces it extends.Also used to specify an upper bound on a type parameter in Generics. TERM 19

final

DEFINITION 19 Define an entity once that cannot be changed nor derived from later. More specifically: a final class cannot be subclassed, a final method cannot be overridden, and a final variable can occur at most once as a left-hand expression. All methods in a final class are implicitlyfinal. TERM 20

finally

DEFINITION 20 Used to define a block of statements for a block defined previously by thetrykeyword. Thefinallyblock is executed after execution exits thetryblock and any associatedcatchclauses regardless of whether an exception was thrown or caught, or execution left method in the middle of thetryorcatchblocks using thereturnkeyword.

float

Thefloatkeyword is used to declare a field that can hold a 32- bitsingle precisionIEEE 754 floating-point number.[7][8]This keyword is also used to declare that a method returns a value of the primitive typefloat TERM 22

for

DEFINITION 22 Theforkeyword is used to create afor loop, which specifies a variable initialization, aboolean expression, and an incrementation. The variable initialization is performed first, and then the boolean expression is evaluated. If the expression evaluates totrue, the block of statements associated with the loop are executed, and then the incrementation is performed. The boolean expression is then evaluated again; this continues until the expression evaluates tofalse TERM 23

goto

DEFINITION 23 Although reserved as a keyword in Java,gotois not used and has no function TERM 24

if

DEFINITION 24 Theifkeyword is used to create anif statement, which tests aboolean expression; if the expression evaluates totrue, the block of statements associated with the if statement is executed. TERM 25

implements

DEFINITION 25 Included in a class declaration to specify one or moreinterfacesthat are implemented by the current class. A class inherits the types and abstract methods declared by the interfaces.

new

Used to create an instance of a class or array object. TERM 32

null

DEFINITION 32 nada empty zip zilch