¡GoConqr estrena diseño! Cuéntanos qué te parece.

Mapa mental

Methods and Classes

Shahmeran Gilani Fundamental Programing Exams Inglés

Methods and Classes

Contenido del mapa

Methods and Classes

  1. Methods

    • Code block that contains many statements
    • Three ways of depicting methods
      • Method signature
        • Has a type
        • Brief description of what method does
        • Has a name and parameters
          • parameters are place holders located in the parenthesis
        • [return type] + [name of method]+(parameters)
      • Call to the method
        • has a name but no type
        • instead of parameters (as placeholders) it has arguments in the paranthesis
        • [name] +(arguments)
      • Method Declaration
        • contains comments
        • Includes Method signature
        • contains the "scope" or body of code within the method signature
    • Types of methods
      • Methods that take no parameters and return nothing
        • Consone.WriteLine()
      • Methods that take a parameter but do nothing
        • Console.Writeline("Hello")
      • Methods that take no parameters but do something
        • age =int.parse(Console.Readline())
    • Method Overloading
      • Using a method with the same name but different parameters
      • Useful to distinctly use the same method with different data types
    • Methods that are of the void type do not need a return method
    • Main method is the entry point for C# programs.
      • Also called the Common Language Runtime (CLR)
    • Passing by reference vs Passing by value
      • When you send a value into a call to a method, you are sending a copy of the original object rather than the object itself. Changes that occur have NO effect on the original object
      • When you send a reference to an object in a call to a method, you are not send the object anymore but rather the argument which indicates the LOCATION of the object. If you change the member object by using this reference, the change will be reflected in the original object
    • Return Values
      • Only applicable if the method is declared as a non-void type
      • Code after the return type does not get executed.
      • Return types must be the same as declared in the method signature
  2. General information

    • Refactoring is when you take a existing solution and change it into a new solution
    • Methods must have a return statement for them to return a value. anything after the return statement is ignored!
    • Debugging
      • Step Into
        • Used when you want to see what is happening inside the code
        • Used to check the code flow
      • Step over
        • Allows debugger to continue
        • Used as a high level approach
  3. Static vs Non Static class

    • Static class cannot be instantiated or cannot be use the new keyword to create a variable of a static class
      • i.e static string GetUserInput( string X)

Imágenes y archivos del mapa

  • Methods and Classes
  • Methods and Classes
  • Methods and Classes

Información

Descripción
Covers Looping logic, Call to method & Method signature , Arrays
Visitas
4
Historial
  • Creado por Shahmeran Gilani · 29 jun 2016
  • Copiado por Shahmeran Gilani · 14 jul 2016
Valoración

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?