CLASSES & SORTING

Cards (42)

  • are used to divide and sort functionalities within a class so that the code will be readable even if it's long.
    METHODS
  • What syntax is this?
    modifiers returntype methodName(){ //Statements here }
  • The element is accessible from any other class.
    Public
  • The element is accessible within its own package and by subclasses, even if they are in a different package.
    protected
  • Also known as package-private. The element is accessible only within its own package.

    default
  • The element is accessible only within its own class.
    private
  • The element belongs to the class rather than to instances of the class.
    static
    • A program
    ~ a class that has a method named main.
    ~ Execution begins in the main method
    Methods Main
  • public static void main(String[] args){ methodName(); } syntax for what?
    method call
  • in the flow of execution, the execution always begins with the first statement in what method?
    main
  • these are methods that executes only when called
    user-defined methods
  • is the identifier declared within a method or block, which is also visible only within that method or block
    local identifier
  • java does not allow the nesting of methods: true false
    true
  • a _ parameter receives a copy of its corresponding _ parameter
    formal : actual
  • if a formal parameter is a reference variable, it copies the _ of corresponding actual parameter
    valye
  • always a stand-alone statement
    call to method
  • A value that needs to be passed on a method so that the method can use that value and perform various operations on it
    parameters/arguments
  • more than one method can have the same name
    method overloading
  • one parameter must differ in at least one position, to consider that two methods are said to have different parameter list (t/f)
    true
  • a relatively new approach to programming which supports the creation of new data types and operations to manipulate those types
    OOP
  • It focuses on implementing real world objects using Classes to create variations of Objects, that has attributes and purpose. It helps us create much flexible and efficient code than procedural programming

    Object Oriented Programming
  • It is created by the programmer, It will act as a blueprint of an object that you want to implement in your program. They contain all the attributes and methods that your desired object should have.
    CLASSES
  • class is a _ word; and a collection of a fixed number of components
    reserved
  • members of the class are accessed by what?
    name
  • provide atleast three categories/modifiers of classes
    private
    protected
    public
  • this class modifier's class members are not accessible outside class
    private
  • through this modifier, members of class are accessible outside class
    public
  • it is the process of creating an object using a class so we can use it on our program
    class instantiation
  • this is created by instantiating a class
    object
  • it is anything that has an attribute and a purpose
    objects
  • these are the global variables declared inside the class of our object
    attributes
  • It is used to create variations of an objects using only one class.
    attributes
  • is a method called when you instantiate a class/create an object
    constructors
  • used to initialize attributes of an object or run a block of code when an object is created

    constructors
  • without parameter constructor is also known as?
    default constructor
  • "this" is a what word?
    keyword
  • this keyword enables you to access global variables inside the class if you have the same variable names in a parameter
    this
  • means to put data in order; either numerically or alphabetically.
    Sorting
  • this also greatly increases the speed of data retrieval
    sorting
  • is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order
    Bubble sort