Midterm vocab Flashcards
determine the accessibility of an object’s properties and methods to other methods in the app
access modifier
a method that is automatically called when an app is executed
Main Method
can be called from outside the class’s declaration’s body by methods of other classes
public accessor “public”
a methods return type, indicates that a method will not return any information to its calling method when it completes a task
keyword “void”
ex: public void DisplayMessage();
method header
ex: public static void Main(string[ ] args);
method can be called w/o first creating an object of the class
keyword “static”
are accessible to all classes in the same project
class types (creating new classes)
object creation expression
Gradebook mygb = new Gradebook();
ex: Gradebook mygb = new Gradebook(); creates a new object of the class specified to the right of the keyword (ie Gradebook)
new operator
required, the parenthesis in combination with a class name represent a call to the instructor, which is similar to a method, but used only at the time an object is created to initialize the object’s data
Gradebook mygb = new Gradebook()
graphical language used by programmers to represent their object-oriented systems in a standardized matter // summarizes a class’s attributes and operations
UML
ON A URL DIAGRAM:
+DisplayMethod()
public visibility symbol
additional information needed to perform a method
parameter
ex: public void DisplayMethod();
located in the parenthesis that follow the method name.
parameter list
indicates to the compiler that the app uses classes in a particular namespace
using directives
System.Console.WriteLine(“”);
fully qualified class name
variables declared in a body of a method and can only be used in that method
local variables
attributes represented by variables; declared inside a class declaration but outside the bodies of the class’s methods declarations
instance variables (fields)
used to manipulate an object’s attributes
property
accessible only to members of the class in which they’re declared
public accessor “private”
declaring instance variables with access modifier private
information hiding (encapsulation)
property declaration
ex:
private string courseName; (instance variable)
public string CourseName { get { return courseName; } set { courseName = value; } }
enables a client to read the value of an instance variable
get accessor
enables a client to modify the instance variable
set accessor
can be read or written by any property or method in the program
public instance variable
the client-code can access the instance variable ONLY indirectly through the class’s non-private properties or methods.
private instance variable
C# compiler creates a private instance variable, and the get/set accessors for returning and modifying the private instance variables
auto-implemented property
allows you to insert pre-defined code termplates
code snippets
simple types (int and double); contains a value of that type
value types
sometimes called a reference, contains the address of a location in memory where the data referred to by that variable is stored
(refer to an object)
reference types
used to initialize an object of a class when the object is created, must have same name as class
constructor
type float, have seven significant digits
single-precision floating-point numbers
type double, have 15-16 significant digits
double -precision floating-point numbers
has 28-29 significant digits
decimal