2021 Java Programming Vocabulary Final Exam

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

methodName();

How do you call a method in Java?

False

Java is short for "JavaScript". True or False.

methodName()

How do you create a method in Java?

Modulus (%)

Returns the remainder of a division operation involving to integers

[]

To declare an array in Java, define the variable type with:

float

variable declaration for the primitive data type that is 4 bytes in size and includes floating-point numbers in the range of +/-3.4 x 10^-38 to +/-3.4 x 10^38, with 7 digits of accuracy

float x = 2.8f;

How do you create a variable with the floating number 2.8?

int x = 5;

How do you create a variable with the numeric value 5?

if (x > y)

How do you start writing an if statement in Java?

*

Which operator is used to multiply numbers?

break

Which statement is used to stop a loop?

Boolean Expressions

is either true or false (used for if statements)

0

Array indexes start with:

System.out.println("Hello World");

Correct syntax to output "Hello World" in Java?

// for short comments and /* */ for longer

How do you insert COMMENTS in Java code?

while (x > y)

How do you start writing a while loop in Java?

a set of well defined steps for performing a task or solving a problem, sequentially ordered.

What is the definition of an Algorithm?

String

Which data type is used to create a variable that stores text?

class

Which keyword is used to create a class in Java?

import

Which keyword is used to import a package from the Java API library?

Math.max(x,y)

Which method can be used to find the highest value of x and y?

toUpperCase()

Which method can be used to return a string in upper case letters?

==

Which operator can be used to compare two values?

The + sign

Which operator is used to add together two values?

byte

variable declaration for the primitive data type that is 1 byte in size and includes integers in the range of -128 to +127

short

variable declaration for the primitive data type that is 2 bytes in size and includes integers in the range of -32,768 to +32,767

double

variable declaration for the primitive data type that is 4 bytes in size and includes floating-point numbers in the range of +/-1.7 x 10^-308 to +/-1.7 x 10^308, with 15 digits of accuracy

int

variable declaration for the primitive data type that is 4 bytes in size and includes integers in the range of -2,147,483,648 to +2,147,483,648

long

variable declaration for the primitive data type that is 8 bytes in size and includes integers in the range of -9,223,372,036,854,775 to +9,223,372,036,854,775


Ensembles d'études connexes

S3 Practice Written Comp #1 (3/2/23 ) - 56/70

View Set

Chapter One: What Does it Mean to be a Leader?

View Set

Examen oral: preguntas en el pasado

View Set

Професійна самосвідомість викладача закладу вищої освіти: аспект професійної комунікації

View Set