O GoConqr está de visual novo! Conte para nós o que você achou.

Flashcards

Java

James Macaulay Inglês 33 flashcards

Java

Flashcards do conjunto (33)

  1. 1OverloadingDefining the same method name with different arguments.
  2. 2OverridingDefining the same method name with the same arguments.
  3. 3GettersGet the values of instance variables.
  4. 4SettersSetter Methods directly access and alter instance variables.
  5. 5Creating a Class.public class name
    {
    }
  6. 6Instance VariablesVariables that will be used in the class. Will be initialized in the constructor.
  7. 7Constructorpublic name(arguments)
    {
    super();
    variable1 = x;
    variable2 = y;
    }
  8. 8Object DiagramObject Diagram
  9. 9Concatentationreturn x + y;
    return " " + x.method() + y.method();
    return "this is a string" + z.method();
  10. 10SuperclassUsed to specify common behavior exhibited by subclasses of the same superclass.
  11. 11PolymorphisimHaving the same messages sent to different objects, which perform their own behavior.
  12. 12InterfacesUsed when classes are otherwise unrelated but their instances have a common set of messages to which they must respond.
  13. 13EncapsulationA class that defines both attributes(variables) and methods that allow interaction with the variables. Combination of both data and operations within a single object is encapsulation.
  14. 14PublicCan be accessed by any class
  15. 15PrivateCan only be accessed by the class it is in.
  16. 16Abstract ClassDefines common message protocols and instance variables for it sub classes but which you cannot use to create objects,
  17. 17PersistenceSaving data in a non-volatile form, which can be achieved by saving it to a file.
  18. 18FileReaderBufferedReader bufferedFileReader = new BufferedReader(new FileReader(aFile);
  19. 19FileWriterBufferedWriter bufferedFileWriter = new BufferedWriter(new FileWriter(aFile));
  20. 20lineScannerlineScanner = new Scanner(BufferedReader.nextLine);
  21. 21DelimiterlineScanner.useDelimiter(",");
  22. 22Comparable1.To be able to compare objects.
    2.To be able to sort into ascending or descending order.
    3. Enforces a protocol on classes that implement it.
    4. If using TreeSet the class must implement Comparable.
  23. 23iterating through a listfor (String x: XList)
    {
    statements
    }
  24. 24iterating with indexingfor(int x = 0; xindex < xList.size(); xindex++)
    {
    statements
    }
  25. 25create mapMap variableName;
  26. 26SetsSet variable;
    Setvariable = new SetType<>();
  27. 27variable reference diagramvariable reference diagram
  28. 28SubstitutabilityWhere a subclass type is compatible with the superclass type. Making it legal to assign an object to a variable declared to be of the type of it direct or indirect superclass.
  29. 29Formal argument and actual argumentaddName(string newName) is the formal argument used in the method.
    names.addName("James") is the actual argument used in sending a message.
  30. 30Sequence diagramSequence diagram
  31. 31Design by contract exampleThe amount that debit() has received (as an argument) is to be deducted from the account’s balance, provided there is at least that amount of money already in the account and the amount received to be deducted is a positive value. After this the method is to return true.
    If the above conditions for the amount to be deducted and balance are not met, the method returns false.
  32. 32new line writingString newLine = System.getProperty("line.separator");
  33. 33ReadingWhile(depends on if currentline has been declared)
    lineScanner = new Scanner(currentLine);
    lineScanner.useDelimiter(",");

Informações

Descrição
FlashCards sobre Java, criado por James Macaulay em 31-05-2015.
Criado por
James Macaulay
Visualizações
2
Avaliação

Fale Conosco

Sobre o que é sua mensagem?

O que você acha do novo visual?

Você gostou?