Java Final

Cards (45)

  • Greater than comparison operator:

    >
  • Less than comparison operator:
    <
  • Greater than or equal to comparison operator
    >=
  • Less than or equal to comparison operator:
    <=
  • Boolean operator for AND:

    &&
  • Boolean operator for OR:

    ||
  • Boolean operator for NOT:

    !
  • what is the increment operator?

    x++;
  • what is the decrement operator?
    x--;
  • what is the += arithmetic operator equivalent to?

    a = a +2
  • what is the -= arithmetic operator equivalent to?
    b = b -3
  • what is the *= operator equivalent to?

    a = a * 3
  • what is the /= arithmetic operator equivalent to?

    b = b/2
  • what is the %= arithmetic operator equivalent to?
    a = a % 5
  • how do you declare and initialize a variable?
    int numberOfStudents = 50;
  • how do you declare a constant?
    final int MAX_STUDENTS = 100;
  • how do you write a JAVA statement to create an object?
    MyClass myObject = new MyClass(argument1, argument2);
  • define the purpose of a constructor
    initialize objects of a class
  • how do you write a constructor
    public MyClass(int initialValue)
  • what is the relationship between a class and an object?
    a class is a template for creating an object, an object is an instance of a class.
  • what is a public visibility modifier?
    accessible from anywhere
  • what is a private visibility modifier?

    accessible only from the same class
  • what is a protected visibility modifier?

    accessible within the same package and by subclasses (regardless of the package)
  • what is a no modifier visibility modifier?
    accessible only within the same package
  • what is a STATIC method?

    associated with the class itself, rather than with any specific instance (object) of the class
  • what is a NON STATIC method? 

    also known as instance methods, are associated with individual instances (objects) of the class
  • what is the purpose and use of INHERITANCE?

    a fundamental concept in object-oriented programming, allowing a class to inherit properties and behaviors from another class
  • what is a SUPER CLASS?
    a class that is being inherited from
  • what is a SUB CLASS?
    a class that inherits from a superclass
  • what is an EXTENDS label in a class header?

    used to establish an inheritance relationship between classes. It indicates that the class is a subclass
  • how do you write a JAVA statement to declare, create, and use a STRING object?

    String myString = "Hello, World!"
  • how do you write a JAVA statement to declare, create, and use a STRING BUFFER object?

    StringBuffer myStringBuffer = new StringBuffer("Hello, World!")
  • what is a scanner class?

    used to read input from various sources such as the keyboard, files, or strings
  • what is a PrintWriter class?

    used to write formatted text to output streams such as files or the console
  • what is a File class?

    used to represent a file or directory path in the file system.
  • what is array reference?

    when you declare an array variable, such as 'int[] numbers;', memory is allocated to store the reference to the array
  • what is an array element?

    when you create the array using the 'new' keyboard, memory is allocated to store the actual elements if the array
  • how do you output a PRINT statement?

    System.out.print("Hello, World!");
  • how do you output a PRINTLN statement?
    System.out.println("\nWelcome to Java!");
  • how do you output a PRINTF statement?
    System.out.printf(num 1: %d, num 2: %.2f%n", num 1, num 2);