Java Programming Fundamentals: Key Concepts and Best Practices

Classified in Computers

Written at on English with a size of 3.03 KB.

Java Programming Fundamentals

Variables and Data Types

  • Which of the following options is not a variable? Literal
  • A block of related data elements is called a table.
  • According to convention, the dollar sign character is never used to start a variable name.
  • An object is a software bundle related to its state.
  • Using 16-bit Unicode.
  • You can use the short data type to save memory in large tables.
  • You do not need to assign a value when a field is declared.
  • Each item in a table is called an element.
  • Parameters are always variables.
  • The length of a table is set when the table is created.

Operators and Expressions

  • The operator with the highest priority is evaluated before operators with lower priority.
  • Operators on the same line have equal priority.
  • If the name of your variable is composed of lowercase letters, only use one word.
  • The name of your variable must not be a keyword.
  • Unary operators require only one operand.
  • "++" is an example of an operator used to increment a value.
  • The conditional operator is also known as the ternary operator.
  • An expression consists of variables, operators, and method invocations.
  • In the example "1 * 2 * 3", the result is always the same.
  • "x + y / 100" is an example of an ambiguous expression.
  • The statements "x + y / 100" and "x + (y / 100)" are equivalent.
  • Unary operators perform various operations, such as incrementing or decrementing a value.
  • The increment/decrement operator can be applied before or after the operand.
  • The Java programming language supports different kinds of operators.
  • You can formulate expressions composed of several smaller expressions, as long as the data type required by one part of the expression matches the data type of the others.
  • Some expressions can be converted into statements by ending them with a semicolon.

Control Flow Statements

  • A block is a group of zero or more statements.
  • The body of a switch statement is known as a switch block.
  • The break statement has two forms: labeled and unlabeled.
  • Which of the following options is not a synonym for the word "concatenate"? Different
  • Control flow statements interrupt the normal flow of execution.
  • A synonym for "break up" is division.
  • The value of testScore can meet more than one expression in the statement: 76 >= 70 and 76 >= 60. A synonym for "meet" is satisfy.
  • The while statement continuously executes a block of statements while a condition is true.
  • The difference between do-while and while is that do-while evaluates its expression at the bottom of the loop instead of the top.

Entradas relacionadas: