wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Variables and Naming Conventions Quiz

Total questions: 128

Worksheet time: 1hrs 4mins

Name
Class
Date
1.

Which of the following is NOT a type of variable mentioned in the content?

a)

Primitive variable

b)

Reference variable

c)

Instance variable

d)

Global variable

2.

According to the content, which statement is true about Java Naming Convention?

a)

It is a guideline for naming identifiers in Java.

b)

It is a rule for assigning values to variables.

c)

It is a method for declaring constants.

d)

It is a way to create assignment statements.

3.

Which of the following is an example of a final variable in Java?

a)

A variable whose value cannot be changed after initialization.

b)

A variable that stores reference to an object.

c)

A variable declared inside a method.

d)

A variable that holds primitive data types.

4.

If you want to store a value that should not change throughout the execution of a Java program, which concept from the content would you use?

a)

Constant

b)

Instance variable

c)

Assignment statement

d)

Reference variable

5.

Which type of variable is typically declared inside a method and only accessible within that method?

a)

Local variable

b)

Instance variable

c)

Reference variable

d)

Final variable

6.

How would you apply the concept of assignment statement in Java to initialize a variable?

a)

By using the equals sign (=) to assign a value to a variable.

b)

By declaring a variable as final.

c)

By following Java naming conventions.

d)

By creating a constant.

7.

Which of the following is a requirement when writing identifiers in Java?

a)

Follow Java naming conventions.

b)

Use only uppercase letters.

c)

Start with a number.

d)

Include special characters.

8.

What is the correct procedure to declare a variable in Java?

a)

Specify the data type followed by the variable name.

b)

Write the variable name followed by the data type.

c)

Use only the variable name.

d)

Declare variables without specifying a type.

9.

After declaring a variable in Java, what is the next step to use it in a program?

a)

Assign a value to the variable.

b)

Delete the variable.

c)

Rename the variable.

d)

Ignore the variable.

10.

Suppose you are writing a Java program and need to store a user's age. Which of the following steps should you follow to ensure proper variable usage? (Select the best sequence)

a)

Declare an appropriate variable, then assign a value to it.

b)

Assign a value before declaring the variable.

c)

Use the variable without declaring or assigning a value.

d)

Declare the variable and never assign a value.

11.

What are the names given to classes, variables, and methods in Java called?

a)

Identifiers

b)

Functions

c)

Keywords

d)

Operators

12.

Which of the following best describes a Java identifier?

a)

A name that identifies elements such as classes, methods, and variables in a program

b)

A reserved word used by the Java compiler

c)

A type of data structure in Java

d)

A special symbol used in Java syntax

13.

Why are there rules for what constitutes a legal Java identifier?

a)

To ensure that names for classes, methods, and variables are valid and recognized by the Java compiler

b)

To make Java code run faster

c)

To allow the use of any character in names

d)

To prevent the use of numbers in variable names

14.

Why might Java programmers follow naming conventions beyond what is legally required by the language?

a)

To improve code readability and maintainability

b)

To make the code run faster

c)

To avoid using any reserved words

d)

To reduce the size of the compiled program

15.

Suppose you are designing a Java program with several classes and methods. How would following naming conventions for identifiers benefit your team during collaborative development?

a)

It would make the code easier to understand and maintain for all team members.

b)

It would automatically optimize the program’s performance.

c)

It would prevent all syntax errors in the code.

d)

It would allow the use of any language for naming.

16.

Which of the following is a valid starting character for a Java identifier?

a)

Number

b)

Dollar sign ($)

c)

Space

d)

Hyphen (-)

17.

After the first character, which of the following can Java identifiers contain?

a)

Only letters

b)

Only numbers

c)

Letters, currency characters, connecting characters, or numbers

d)

Only currency characters

18.

What is the limit to the number of characters an identifier can contain in Java?

a)

10 characters

b)

255 characters

c)

No limit

d)

1000 characters

19.

Which of the following can NOT be used as a Java identifier?

a)

myVariable

b)

true

c)

_value

d)

$amount

20.

If you declare two identifiers in Java, "uthm" and "Uthm", what is true about them?

a)

They refer to the same variable

b)

They are different identifiers

c)

They are both invalid

d)

They are both reserved keywords

21.

Why can't you use a Java keyword as an identifier?

a)

Because keywords are reserved for specific language functions

b)

Because keywords are too long

c)

Because keywords are case-insensitive

d)

Because keywords must start with a number

22.

Suppose you want to create a Java identifier for a variable that stores a user's age. Which of the following would be a valid identifier?

a)

1age

b)

age_user

c)

null

d)

user-age

23.

Which of the following is a valid identifier in most programming languages like C or Java?

a)

int _a;

b)

int .f;

c)

int 2_w;

d)

int -d;

24.

Which identifier is NOT valid according to typical programming language rules?

a)

int $c;

b)

int 2_w;

c)

int _a;

d)

int _$;

25.

Why is "int 2_w;" not a valid identifier in most programming languages?

a)

Identifiers cannot start with a digit.

b)

Identifiers cannot contain underscores.

c)

Identifiers must end with a semicolon.

d)

Identifiers cannot contain letters.

26.

Which of the following identifiers is valid and follows the rules for naming variables?

a)

int this_is_a_detailed_name_for_identifier;

b)

int .f;

c)

int -d;

d)

int 7g;

27.

Select the identifier that is invalid because it contains a special character not allowed in most programming languages.

a)

int e#;

b)

int _$;

c)

int _a;

d)

int this_is_a_detailed_name_for_identifier;

28.

Given the identifier "int _$;", which of the following best explains why it is valid?

a)

Identifiers can start with an underscore or a dollar sign.

b)

Identifiers must start with a digit.

c)

Identifiers cannot contain underscores.

d)

Identifiers must contain at least one number.

29.

If you were to create a new variable name, which of the following would be the best practice to ensure it is valid?

a)

Start with a letter or underscore, and use only letters, digits, or underscores.

b)

Start with a digit and use any special character.

c)

Use spaces to separate words in the identifier.

d)

Use a period (.) to start the identifier.

30.

Which of the following is a valid identifier in most programming languages?

a)

2_w

b)

.f

c)

__a

d)

-d

31.

Why is the identifier "2_w" considered invalid?

a)

It contains a hyphen

b)

It starts with a digit

c)

It contains a dollar sign

d)

It contains an underscore

32.

Which character is NOT allowed in identifiers according to the rules provided?

a)

Underscore (_)

b)

Dollar sign ($)

c)

Dot (.)

d)

Letter (a-z)

33.

Given the identifier "int this_is_a_detailed_name_f_or_identifier;", why is it considered valid?

a)

It contains a hash sign (#)

b)

It starts with a digit

c)

It uses only allowed characters (letters and underscores)

d)

It contains a hyphen (-)

34.

If you want to create a valid identifier, which of the following rules must you follow?

a)

It can start with any character, including digits

b)

It can contain illegal characters like dot (.) and hyphen (-)

c)

It must start with a letter, underscore, or dollar sign

d)

It must contain at least one digit

35.

Strategic Thinking: You are reviewing code and see the identifier "int e#;". Based on the rules, what is the best explanation for why this identifier is invalid?

a)

It starts with a digit

b)

It contains a hash sign (#), which is not allowed

c)

It contains a dollar sign ($), which is not allowed

d)

It is too long

36.

Skill/Concept: If you are given the identifier "int $c;", how would you determine if it is valid or not?

a)

Check if it starts with a digit

b)

Check if it contains only allowed characters (letters, digits, underscores, dollar signs)

c)

Check if it contains a dot (.)

d)

Check if it contains a colon (:)

37.

Strategic Thinking: You need to create an identifier for a variable that stores a user's age. Which of the following would be the best choice?

a)

7g

b)

user-age

c)

user_age

d)

user.age

38.

According to Oracle's Java naming conventions, what should be true about the first letter of a class or interface name?

a)

It should be lowercase.

b)

It should be capitalized.

c)

It should be a number.

d)

It should be an underscore.

39.

What is the recommended naming convention for multi-word class or interface names in Java?

a)

All words should be lowercase.

b)

Only the first word should be capitalized.

c)

The first letter of each inner word should be uppercase (camelCase).

d)

Use underscores between words.

40.

Which of the following is an example of a properly named Java class according to Oracle's recommendations?

a)

animal

b)

accountNumber

c)

PrintWriter

d)

serializable

41.

Why are class names in Java typically nouns, while interface names are typically adjectives?

a)

Because classes represent objects and interfaces represent behaviors.

b)

Because classes are always abstract and interfaces are always concrete.

c)

Because classes are used for variables and interfaces for methods.

d)

Because classes are written in uppercase and interfaces in lowercase.

42.

Given the following names, which one best follows the Java interface naming convention?

a)

Animal

b)

Account

c)

Runnable

d)

PrintWriter

43.

If you are creating a Java class to represent a bank account, which of the following names best follows the naming conventions described?

a)

bankaccount

b)

BankAccount

c)

bankAccount

d)

BANKACCOUNT

44.

According to Java naming conventions for methods, how should the first letter of a method name be written?

a)

Uppercase

b)

Lowercase

c)

In bold

d)

In italics

45.

Which of the following is the correct naming convention for Java methods?

a)

getbalance

b)

GetBalance

c)

getBalance

d)

get_balance

46.

Given the following method names, which one does NOT follow the Java naming convention described?

a)

doCalculation

b)

setCustomerName

c)

CalcArea

d)

getBalance

47.

Which naming convention is recommended for Java variables?

a)

camelCase

b)

PascalCase

c)

snake_case

d)

UPPERCASE

48.

According to Oracle, what type of names should be used for Java variables?

a)

Short and meaningful names

b)

Long and complex names

c)

Randomly generated names

d)

Names with special characters

49.

Which of the following is a correct example of a Java variable name following the recommended convention?

a)

buttonWidth

b)

Buttonwidth

c)

button_width

d)

BUTTONWIDTH

50.

Why is it important to start Java variable names with a lowercase letter when using camelCase?

a)

It distinguishes variables from class names and follows Java conventions.

b)

It makes the code run faster.

c)

It allows variables to be used globally.

d)

It is required for all programming languages.

51.

Which of the following is the correct way to create a constant in Java?

a)

By marking a variable as static and final

b)

By marking a variable as public and private

c)

By marking a variable as abstract and volatile

d)

By marking a variable as synchronized and transient

52.

According to Java naming conventions, how should constants be named?

a)

Using uppercase letters with underscore characters as separators

b)

Using lowercase letters with hyphens as separators

c)

Using camelCase notation

d)

Using PascalCase notation

53.

Given the following variable names, which one follows the Java naming convention for constants?

a)

minHeight

b)

Min_Height

c)

MIN_HEIGHT

d)

min_height

54.

Why is it important to use uppercase letters and underscores when naming constants in Java?

a)

It distinguishes constants from variables and improves code readability

b)

It makes the code run faster

c)

It is required for all variable names in Java

d)

It allows the constant to be changed at runtime

55.

Which of the following identifiers follows the Java naming convention for class names?

a)

MyCar

b)

run()

c)

address

d)

YEAR

56.

According to Java naming conventions, which identifier is most appropriate for a method name?

a)

Submit()

b)

LECTURER

c)

ObjectOrientedProgramming

d)

YEAR

57.

Which of the following variable names best follows the Java naming convention for variables?

a)

address

b)

StopTheCar()

c)

LECTURER

d)

ObjectOrientedProgramming

58.

Which of the following identifiers does NOT follow the Java naming convention for class names?

a)

LECTURER

b)

ObjectOrientedProgramming

c)

MyCar

d)

StopTheCar()

59.

Evaluate the following identifier: "StopTheCar()". Is it following the Java naming convention for method names? Justify your answer.

a)

Yes, because method names should use camelCase and start with a lowercase letter.

b)

No, because method names should be in all uppercase.

c)

Yes, because method names should start with an uppercase letter.

d)

No, because method names should not use parentheses.

60.

Given the variable names "address", "Name", and "YEAR", which one(s) do NOT follow the Java naming convention for variables?

a)

Name and YEAR

b)

address and Name

c)

YEAR only

d)

address only

61.

Which of the following identifiers follows the PascalCase naming convention?

a)

MyCar

b)

mycar

c)

MYCAR

d)

myCar

62.

Why does the identifier "LECTURER" not follow the class naming convention?

a)

Because it uses all uppercase, which is convention for constants, not classes.

b)

Because it uses PascalCase.

c)

Because it starts with a lowercase letter.

d)

Because it contains numbers.

63.

What is the main characteristic of PascalCase as used in class naming conventions?

a)

Each word starts with a capital letter.

b)

All letters are uppercase.

c)

All letters are lowercase.

d)

Words are separated by underscores.

64.

Given the identifier "ObjectOrientedProgramming", does it follow the class naming convention? Explain your reasoning.

a)

Yes, because it uses PascalCase.

b)

No, because it uses all uppercase.

c)

No, because it uses underscores.

d)

Yes, because it uses all lowercase.

65.

Which of the following identifiers follows the camelCase naming convention?

a)

Submit()

b)

run()

c)

StopTheCar()

d)

RunTheCar()

66.

Why does the identifier "Submit()" not follow the camelCase convention?

a)

It contains numbers

b)

It starts with an uppercase letter

c)

It is too short

d)

It uses underscores

67.

If you want to correct the identifier "StopTheCar()" to follow camelCase convention, which of the following should you use?

a)

stopthecar()

b)

Stopthecar()

c)

stopTheCar()

d)

StopTheCar()

68.

Suppose you are reviewing code and see the identifier "CalculateSum()". Based on the conventions discussed, what change would you recommend?

a)

Change it to calculateSum()

b)

Change it to Calculate_Sum()

c)

Change it to calculatesum()

d)

Leave it as is

69.

Which identifier follows the camelCase naming convention for a single word?

a)

address

b)

Name

c)

YEAR

d)

MAX_YEAR

70.

Why does the identifier "Name" not follow the naming convention?

a)

It uses all lowercase letters.

b)

It starts with an uppercase letter.

c)

It uses all uppercase letters.

d)

It contains special characters.

71.

According to naming conventions, when should all uppercase letters be used for an identifier?

a)

For regular variables

b)

For constants

c)

For function names

d)

For class names

72.

Given the identifier "YEAR", how should it be written to follow the convention for a regular variable?

a)

YEAR

b)

Year

c)

year

d)

maxYear

73.

If you are naming a variable to store a client's name, which of the following is the best choice according to camelCase convention?

a)

ClientName

b)

clientName

c)

CLIENTNAME

d)

clientname

74.

Which of the following best describes the purpose of variables in a program?

a)

To store data in a program.

b)

To perform calculations automatically.

c)

To display output to the user.

d)

To connect to the internet.

75.

How many types of variables are there in Java?

a)

Two

b)

Three

c)

Four

d)

One

76.

Which of the following is NOT a type of variable in Java?

a)

Constant variable

b)

Primitive variable

c)

Reference variable

77.

Suppose you are designing a Java program that needs to store both simple data values and objects. Which types of variables would you use, and why?

a)

Primitive variables for simple data and reference variables for objects, because primitive variables store basic data types and reference variables store addresses to objects.

b)

Reference variables for simple data and primitive variables for objects, because reference variables are faster.

c)

Only primitive variables, because Java does not support reference variables.

d)

Only reference variables, because primitive variables are obsolete.

78.

Which of the following is NOT a primitive data type in Java?

a)

char

b)

boolean

c)

String

d)

int

79.

Once a primitive variable has been declared in Java, what can never change?

a)

Its value

b)

Its primitive type

c)

Its memory address

d)

Its scope

80.

Primitive variables in Java can be declared as which of the following? (Select the most complete answer.)

a)

Only as local variables

b)

Only as class variables

c)

As class variables, instance variables, method parameters, or local variables

d)

Only as method parameters

81.

Which of the following is a correct example of declaring multiple primitive variables of the same type in a single line?

a)

int x, y, z;

b)

int x = y = z;

c)

int x; y; z;

d)

int(x, y, z);

82.

Suppose you want to declare a variable to store the area of a circle using a primitive type. Which declaration is most appropriate?

a)

double area;

b)

boolean area;

c)

char area;

d)

String area;

83.

Explain why the primitive type of a variable cannot be changed after declaration, but its value can usually be changed. Provide an example to support your explanation.

a)

The primitive type is fixed at compile time, but the value can be reassigned during program execution. For example, 'int x = 5; x = 10;' is valid, but 'int x = 5; x = 10.5;' is not.

b)

The primitive type can be changed at runtime, but the value cannot be changed.

c)

Both the primitive type and value can be changed at any time.

d)

Neither the primitive type nor the value can be changed after declaration.

84.

What is the primary purpose of a reference variable in programming?

a)

To refer to (or access) an object.

b)

To store primitive data types.

c)

To perform arithmetic operations.

d)

To define a function.

85.

Once a reference variable is declared to be of a specific type, what can be said about its type?

a)

Its type can never be changed.

b)

Its type can be changed at runtime.

c)

Its type is determined by the value assigned.

d)

Its type is always integer.

86.

Which of the following is NOT a valid way to declare reference variables?

a)

int x, y;

b)

Object o;

c)

String s1, s2, s3;

d)

Car proton, audi;

87.

Reference variables can be declared as which of the following? (Select the most complete answer.)

a)

Static variables, instance variables, method parameters, or local variables.

b)

Only static variables.

c)

Only local variables.

d)

Only method parameters.

88.

A reference variable declared as "Animal myNewPetReferenceVariable;" can refer to which of the following?

a)

Any object of type Animal or its subtype.

b)

Only objects of type String.

c)

Only primitive data types.

d)

Any object, regardless of type.

89.

Suppose you want to declare three reference variables of type String in a single line. Which of the following is the correct way?

a)

String s1, s2, s3;

b)

String; s1 s2 s3

c)

String: s1 s2 s3;

d)

String s1 s2 s3;

90.

Which of the following best describes an instance variable in a class?

a)

A variable defined inside the class but outside any method, and initialized when the class is instantiated.

b)

A variable defined inside a method and shared by all objects.

c)

A variable defined outside the class and accessible globally.

d)

A variable that cannot be accessed by any object.

91.

In the code example provided, what is the instance variable for the Circle class?

a)

radius

b)

Circle

c)

Object

d)

double

92.

What is the main purpose of an instance variable in an object-oriented class?

a)

To store unique values for each object instance.

b)

To store values shared by all instances of the class.

c)

To define the methods of the class.

d)

To initialize the class header.

93.

Which terms are considered virtually synonymous in the context of object-oriented programming?

a)

Field, instance variable, property, attribute

b)

Method, function, procedure, loop

c)

Class, object, interface, package

d)

Header, footer, body, tail

94.

Suppose you have a class with an instance variable called "age." If you create two objects from this class and set their "age" values to 20 and 30 respectively, what will be the value of "age" for each object?

a)

Each object will have its own unique "age" value (20 and 30).

b)

Both objects will share the same "age" value.

c)

The "age" value will be set to 0 for both objects.

d)

The "age" value will be undefined for both objects.

95.

Which of the following is a common practice when naming a parameter in a method that assigns its value to an instance variable?

a)

Naming the parameter differently from the instance variable

b)

Naming the parameter with the same name as the instance variable

c)

Using only uppercase letters for parameter names

d)

Avoiding parameters altogether

96.

What is the main issue with the following code implementation? class Try { int size; public void setSize(int size) { size = size; // but which size equals which size? } }

a)

The method does not return a value

b)

The assignment is ambiguous and does not set the instance variable

c)

The code uses an undefined variable

d)

The method name is incorrect

97.

Why does the code 'size = size;' inside the setSize method produce an error or unexpected behavior?

a)

It tries to assign a value to a constant

b)

It causes a syntax error due to missing semicolon

c)

It assigns the parameter to itself, not the instance variable

d)

It uses an undeclared variable

98.

(DoK Level 1) What keyword is used in Java to resolve naming collisions between instance variables and parameters?

a)

this

b)

super

c)

static

d)

final

99.

Which of the following is not a valid Java identifier?

a)

_myVar

b)

2ndValue

c)

value_2

d)

$amount

100.

What is the main reason why the identifier int class; is invalid in Java?

a)

It starts with a lowercase letter

b)

It is too short

c)

It uses a reserved keyword

d)

It contains a special character

101.

Which of the following statements about Java identifiers is true?

a)

Identifiers must always start with a digit

b)

Identifiers are case-sensitive

c)

Identifiers cannot contain underscores

d)

Identifiers can contain spaces

102.

Choose the valid identifier from the following options:

a)

int @value;

b)

int 1stValue;

c)

int value$1;

d)

int #number;

103.

Which of the following is the correct way to declare a constant in Java?

a)

final int MAX_SIZE = 100;

b)

constant int MAXSIZE = 100;

c)

const int maxSize = 100;

d)

static int MAX_SIZE = 100;

104.

What will happen if you try to use a Java keyword as an identifier?

a)

The identifier will be ignored

b)

The program will compile successfully

c)

The program will throw a runtime exception

d)

The compiler will generate a syntax error

105.

Which of the following is the recommended naming convention for Java constants?

a)

MAX_VALUE

b)

Max_Value

c)

maxValue

d)

MAXVALUE

106.

What is the correct way to name a package in Java?

a)

Com.Example.Project

b)

com.example.project

c)

com_example_project

d)

com.Example.Project

107.

Which of the following variable names follows Java's naming conventions?

a)

account_balance

b)

AccountBalance

c)

ACCOUNTBALANCE

d)

accountBalance

108.

Which of the following is NOT a recommended practice for naming Java classes?

a)

Avoid using underscores

b)

Capitalize the first letter of each word

c)

Start class names with a lowercase letter

d)

Use nouns for class names

109.

What is the main reason for using camelCase in Java variable and method names?

a)

To avoid compiler errors

b)

To make code look professional

c)

To follow C++ conventions

d)

To improve readability

110.

Which of the following interface names best follows Java naming conventions?

a)

serializable

b)

serializableInterface

c)

ISerializable

d)

Serializable

111.

Which of the following is a valid Java identifier?

a)

2ndValue

b)

value#2

c)

_secondValue

d)

class

112.

What is the correct way to declare a variable named 'totalAmount' in Java?

a)

int totalAmount;

b)

int total-amount;

c)

int 1totalAmount;

d)

int total amount;

113.

Which of the following statements about Java identifiers is TRUE?

a)

Identifiers are case-sensitive.

b)

Identifiers can contain spaces.

c)

Identifiers can use any special character.

d)

Identifiers can start with a digit.

114.

Choose the invalid identifier from the following options.

a)

_myVar

b)

myVar$

c)

my Var

d)

myVar2

115.

Which of the following is NOT allowed in a Java identifier?

a)

Dollar sign ($)

b)

Space

c)

Underscore (_)

d)

Alphabets

116.

What will happen if you use 'public' as an identifier in Java?

a)

The program will run but give a warning.

b)

'public' will be treated as a variable name.

c)

An error will occur because 'public' is a reserved keyword.

d)

The code will compile successfully.

117.

Which of the following is a valid Java identifier?

a)

my-variable

b)

_myVariable

c)

class

d)

2ndValue

118.

What is the recommended naming convention for Java constants?

a)

UPPER_CASE_WITH_UNDERSCORES

b)

PascalCase

c)

lowercase

d)

camelCase

119.

Which of the following statements about Java class names is correct?

a)

Class names can contain spaces.

b)

Class names should start with a lowercase letter.

c)

Class names should start with an uppercase letter.

d)

Class names must be written in all uppercase letters.

120.

Which option best describes the purpose of using camelCase in Java variable names?

a)

To make variable names shorter

b)

To allow spaces in variable names

c)

To ensure variables are always uppercase

d)

To make variable names easier to read and understand

121.

Which of the following is NOT allowed in a Java identifier?

a)

Space ( )

b)

Digits (0-9)

c)

Dollar sign ($)

d)

Underscore (_)

122.

What is the correct way to declare a final variable in Java?

a)

int final MAX_VALUE = 100;

b)

final int MAX_VALUE = 100;

c)

int MAX_VALUE final = 100;

d)

MAX_VALUE final int = 100;

123.

Which of the following is NOT allowed in a Java variable name?

a)

Numbers (after the first character)

b)

Space ( )

c)

Dollar sign ($)

d)

Underscore (_)

124.

What is the recommended naming convention for Java constants?

a)

lowercasewithunderscores

b)

UPPERCASE_WITH_UNDERSCORES

c)

PascalCase

d)

camelCase

125.

Which of the following is a valid Java identifier?

a)

class

b)

my-variable

c)

2ndVariable

d)

_myVariable

126.

What is the purpose of using descriptive names for variables in Java?

a)

To avoid using comments in code.

b)

To make code easier to understand and maintain.

c)

To increase the execution speed of the program.

d)

To reduce the size of the compiled file.

127.

Which of the following statements about Java identifiers is true?

a)

They can contain spaces.

b)

They can start with a digit.

c)

They are case-sensitive.

d)

They must be written in uppercase.

128.

What is the result of the following Java statement?
int totalAmount = 100;

a)

An error occurs because the variable name is invalid.

b)

A constant named totalAmount is created.

c)

A variable named totalAmount is declared and assigned the value 100.

d)

The value 100 is printed to the console.