IOS development language Swift getting started-Basics
Swift> is a new language for iOS> and> OS X> application development. However, if you have> C> or> Objective-C> development experience, you will find that many content> Swift> is familiar to
1 identifiersis a programmer in the definition of Java programs, some of the custom names, such as the class name, method name, function name, variable name and package name.Naming rules for identifiers:Consists mainly of English letters, numbers,
Constants also provide a convenient form of reading for these values, but unlike enumerations, constants are only a single value and, as their name shows, they are fixed and never changed. This is useful when you want to use a fixed value; Using
The third declaration class keyword introduced by ES6 is similar to let: Const.
Take a look at the usage:
Const C1 = 1;
Const C2 = {};
CONST C3 = [];
Object.getownpropertydescriptor (window, "C1")
//object {value:1,
This is a creation in
Article, where the information may have evolved or changed.
Mainly introduces the basic elements of Go language, Package introduction, variables, function declaration
Introduction Package:
Go language introduces
1. In the MySQL database, the SQL language consists of the following parts. (1) Data Definition Language (DDL ). It is used to execute database tasks and perform create, drop, alter, and other operations on the database and various objects in the
1. Common Data Types
Int, short, long, unsigned, float, double, char, enum, void, pointer type, array type, struct, union, etc.
Basic data types: Int, short, long, unsigned, float, double, char, and enum are all basic data types. The feature
Constants and variables1. Variables(1) variable refers to the amount of variable values that can change while the program is running.(2) assign an initial value to the variableType specifier variable 1 = value 1, variable 2 = value 2 ,......;2.
MySQL experience 6-MySQL language structure-constant, variable bitsCN.com 1. in MySQL database, the SQL language consists of the following parts. (1) Data Definition Language (DDL ). It is used to execute database tasks and perform create, drop,
1. Constants(1) Integral type constant100,23,33 and so on;(2) Real-type constants2.1,34.7, etc.(3) Character constantsOrdinary characters such as ' A ', ' a ', and escape characters(4) String constants"ABC", "342" and so on(5) Symbolic
ConstantA constant is an identifier whose value remains unchanged during running. Constants can only be referenced in the program, but cannot be assigned a value again.Constant naming rules:1. In JAVA, add the final keyword to the variable
One, constantA Java constant is a value that cannot be changed once the value is assigned. Java constants are decorated with the keyword final. General constant names each word has uppercase letters, and multiple words are separated by underscores.
constants: Constants with values unchanged.
Grammar:
Data type constant name = value;
Double PI = 3.14;
Note:
The general default constant name is uppercase.
Relationship between variables and constants (quantity relationship)
Let's start
constants, which are immutable data in any data type during program execution.
For example, the renminbi in your life, 5 yuan banknotes, will not become 50 or 500 yuan in any of the scenes you use.
Programming is code and computer warfare, the data
1. Definition
letDefine constants that are not allowed to be modified once they are assigned, more secure
varDefine variables that can still be modified after assignment
You should select constants as much as possible
--ConstantsThe definition of a constant uses the Define () function, two ways to get a constant, one is to use the constant name directly, and the second is to use the constant () function. Determines whether a constant has been defined using the
Constant definition: The number of values that can be determined during compilation and the value does not change during the program running. Defining constant types include
Int, bool, char, double, sting, etc.
Syntax: const type name constant
Basic Swift data type, swift data typeConstants and variables
Constants and variables are represented by a specific name, such as maximumNumberOfLoginAttempt or welcomeMessage. A constant points to a specific type of value, such as a number of 10 or
Ios swift learning diary 2-basic part, iosswiftThe basic part of Swift is a new language for iOS and OS X application development. However, if you have C or Objective-C development experience, you will find that many Swift content is familiar to you.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.