GoConqr hat ein neues Design! Sag uns, wie es dir gefällt.

Mindmap

methods and parameters of type object

daniela rodriguez Spanisch

Inhalt der Mindmap

methods and parameters of type object

  1. Passing Information to a Method or a Constructor

    • The declaration for a method or a constructor declares the number and the type of the arguments for that method or constructor
  2. Parameters refers to the list of variables in a method declaration.

    • Arguments are the actual values that are passed in when the method is invoked.
      • You use varargs when you don't know how many of a particular type of argument will be passed to the method.
    • This includes primitive data types, such as doubles, floats, and integers, as you saw in the computePayment method, and reference data types, such as objects and arrays.
  3. When you declare a parameter to a method or a constructor, you provide a name for that parameter. This name is used within the method body to refer to the passed-in argument.

    • Many developers use the terms "type parameter" and "type argument" interchangeably, but these terms are not the same.
      • When coding, one provides type arguments in order to create a parameterized type.
  4. A parameter can have the same name as one of the class's fields

  5. public class Circle { private int x, y, radius; public void setOrigin(int x, int y) {

  6. public static void main(String[] args) { int x = 3; // invoke passMethod() with // x as argument passMethod(x); // print x to see if its // value has changed System.out.println("After invoking passMethod, x = " + x);

  7. By convention, type parameter names are single, uppercase letters.

    • Without this convention, it would be difficult to tell the difference between a type variable and an ordinary class or interface name.

Informationen

Beschreibung
Mindmap am methods and parameters of type object, erstellt von daniela rodriguez am 17/05/2019.
Erstellt von
daniela rodriguez
Aufrufe
0
Verlauf
  • Erstellt von daniela rodriguez · 15 Mai 2019
  • Kopiert von daniela rodriguez · 17 Mai 2019
Bewertung

Feedback

Worum geht es?

Wie gefällt dir das neue Design?

Dein Eindruck