When we consider a Java program, it can be defined as a collection of objects that communicate via invoking each other's methods. Let us now briefly look into what do class, object, methods, and instance variables mean.
Object − Objects have states and behaviors. Example: A dog has states - color, name, breed as well as behavior such as wagging their tail, barking, eating. An object is an instance of a class.
Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type supports.
Methods − A method is basically a behavior. A class can contain many methods. It is in methods where the logics are written, data is manipulated and all the actions are executed.
Instance Variables − Each object has its unique set of instance variables. An object's state is created by the values assigned to these instance variables.
Showing posts with label variables. Show all posts
Showing posts with label variables. Show all posts
C# - Attributes & Variables
Attributes enable the programmer to give certain declarative information to the elements in their class. These elements include the class itself, the methods, the fields, and the properties. You can choose to use some of the useful built-in attributes provided with the .NET platform, or you can create your own. Attributes are specified in square brackets ( [. . .] ) before the class element upon which they’re implemented.
Variables
A variable represents a strong location. Each variable has a type that determines what values can be stored in the variable. A variable must definitely be assigned before its value can be obtained. In C#, you declare a variable in this format:
Terminology of Boolean Expressions
A Boolean expression has the following terms
Literals
A literal is a single Boolean variable or it's complement
Constant
A constant is a value or the quantity which has a fixed (unchanging) value. In real number (conventional) algebra, constants include all integers and fractions. In Boolean Algebra, there are only two possible constants 1 and 0. These two constants are used to describe true and false, YES or NO, etc.
Variable
A variable is a quantity which can change its value by taking on the value of any constant. At any one itme the variable has only one particular value of constant. There are only two values of constants in the Boolean System. Therefore, a variable in Boolean algebra can only be either 0 or 1. Variables are denoted by letters.
Term
A term is a literal or a collection of literals.
Product Term
A product ( logical AND) of several different literals is called the product term. For example :
A.B' is a product term
Sum Term
The Logical OR of Literals is called the sum term. For example:
A+B'+C
is an example of sum term
Sum of Products
It is the sum (logical OR) of product terms. For example
A.B' +B.C + A.B.C
is the sum of three different erms i.e. A.B', B.C and A.B.C
Product of Sum
It is tthe product (logical AND) of sum terms. For example:
(A+B).(A+B'+C).(A+C)
is the product of three different sum terms i.e. (A+B), (A+B'+C) and (A+C)
Minterm
A minterm is an AND function that includes each variable once in its normal or complemented form. This is also known as the standard sum of products. For example:
If you have two variables, A and B, there are eight possible terms:
A, B, A', B', A'B', A'B, AB' and AB.
Similarly for three variables we have 26 possible terms.
Maxterm
A maxterm is a logical OR function that includes each variable once in its normal or complemented form. This is known as standard product of sums.
Unix Variables
Variables are a way of passing information from the shell to programs when you run them. Programs look "in the environment" for particular variables and if they are found will use the values stored. Some are set by the system, others by you, yet others by the shell, or any program that loads another program.
Standard UNIX variables are split into two categories, environment variables and shell variables. In broad terms, shell variables apply only to the current instance of the shell and are used to set short-term working conditions; environment variables have a farther reaching significance, and those set at login are valid for the duration of the session.
By convention, environment variables have UPPER CASE and shell variables have lower case names.
LEARN MORE>>
Standard UNIX variables are split into two categories, environment variables and shell variables. In broad terms, shell variables apply only to the current instance of the shell and are used to set short-term working conditions; environment variables have a farther reaching significance, and those set at login are valid for the duration of the session.
By convention, environment variables have UPPER CASE and shell variables have lower case names.
LEARN MORE>>
Structures.....cont(1)
Initializing Structure Elements
The elements of a structure van be initialized either seperately using seperate assignment statements or jointly using the notation similar to that used for initializing arrays. The example given below demonstrates how structure elements can be initialized jointly or seperately.
struct student
{
int rollno;
char name[20];
short clas; // class is a reserved word of C++
float marks;
char grade;
} stud1, stud2;
LEARN MORE>>
The elements of a structure van be initialized either seperately using seperate assignment statements or jointly using the notation similar to that used for initializing arrays. The example given below demonstrates how structure elements can be initialized jointly or seperately.
struct student
{
int rollno;
char name[20];
short clas; // class is a reserved word of C++
float marks;
char grade;
} stud1, stud2;
LEARN MORE>>
Structures
A Structure is a collection of simple variables. The variables of a structure can be of different types: int, float and so on. (this is unlike the array, in which all the elements must be of the same type.) the data items or varible declared in the structure are called the members of the structure. The structure name is often reffered to as its tag.
For C++ programmers, structures are one of the two important building blocks in the understanding of objects and classes.
Defining a Structure
We know that structure is a collection of logically related variables referenced under a single name. These variables can be of different type, and each has a name which is used to select it from the structure.
A structure can be defined as a new named type, thus extending the number of avaialble types. LEARN MORE>>
For C++ programmers, structures are one of the two important building blocks in the understanding of objects and classes.
Defining a Structure
We know that structure is a collection of logically related variables referenced under a single name. These variables can be of different type, and each has a name which is used to select it from the structure.
A structure can be defined as a new named type, thus extending the number of avaialble types. LEARN MORE>>
Subscribe to:
Posts (Atom)