30天代码day2 Operators
Operators
These allow you to perform certain operations on your data. There are 3 basic types:
- Unary: operates on 1 operand
- Binary: operates on 2 operands
- Ternary: operates on 3 operands
Arithmetic Operators
The binary operators used for arithmetic are as follows:
+: Additive-: Subtraction*: Multiplication/: Division%: Remainder (modulo)
Additional Operators
+: A binary operator used for String concatenation++: This unary operator is used to preincrement 前自增(increment by 1 before use) when prepended to a variable name or postincrement 后自增(increment by 1 after use) when appended to a variable.--: This unary operator is used to predecrement 前自减(decrement by 1 before use) when prepended to a variable name or postdecrement 后自减(decrement by 1 after use) when appended to a variable.!: This unary operator means not (negation). It's used before a variable or logical expression that evaluates to true or false.==: This binary operator is used to check the equality of 2 primitives.!=: This binary operator is used to check the inequality of 2 primitives.<,>,<=,>=: These are the respective binary operators for less than, greater than, less than or equal to, and greater than or equal to, and are used to compare two operands.&&,||: These are the respective binary operators used to perform logical AND and logical OR operations on two boolean (i.e.: true or false) statements.? :This ternary operator is used for simple conditional statements (i.e.: if ? then : else).
30天代码day2 Operators的更多相关文章
- 30行代码搞定WCF并发性能测试
[以下只是个人观点,欢迎交流] 30行代码搞定WCF并发性能 轻量级测试. 1. 调用并发测试接口 static void Main() { List< ...
- 30行代码让你理解angular依赖注入:angular 依赖注入原理
依赖注入(Dependency Injection,简称DI)是像C#,java等典型的面向对象语言框架设计原则控制反转的一种典型的一种实现方式,angular把它引入到js中,介绍angular依赖 ...
- 30行代码实现Javascript中的MVC
从09年左右开始,MVC逐渐在前端领域大放异彩,并终于在刚刚过去的2015年随着React Native的推出而迎来大爆发:AngularJS.EmberJS.Backbone.ReactJS.Rio ...
- Tensorflow快餐教程(1) - 30行代码搞定手写识别
版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/lusing/article/details ...
- 10分钟教你用python 30行代码搞定简单手写识别!
欲直接下载代码文件,关注我们的公众号哦!查看历史消息即可! 手写笔记还是电子笔记好呢? 毕业季刚结束,眼瞅着2018级小萌新马上就要来了,老腊肉小编为了咱学弟学妹们的学习,绞尽脑汁准备编一套大学秘籍, ...
- JAVA_SE基础——30.构造代码块
黑马程序员入学blog...构造代码块作用:给所有的对象进行统一的初始化. 问题:要求每个小孩出生都会哭,这份代码有两个构造函数,如果需要每个小孩出生都要哭的话,那么就需要在不同的构造函数中都调用cr ...
- 30天代码day3 Intro to Conditional Statements
Boolean A logical statement that evaluates to true or false. In some languages, true is interchangea ...
- 30 行代码实现 JS 中的 MVC
一连串的名字走马观花式的出现和更迭,它们中一些已经渐渐淡出了大家的视野,一些还在迅速茁壮成长,一些则已经在特定的生态环境中独当一面舍我其谁.但不论如何,MVC已经并将持续深刻地影响前端工程师们的思维方 ...
- 30行代码消费腾讯人工智能开放平台提供的自然语言处理API
腾讯人工智能AI开放平台上提供了很多免费的人工智能API,开发人员只需要一个QQ号就可以登录进去使用. 腾讯人工智能AI开放平台的地址:https://ai.qq.com/ 里面的好东西很多,以自然语 ...
随机推荐
- 用git提交源代码
码云账号 markliuning 作业已经上传 题目要求:定义一个包含有10个整数的数组a并初始化,定义一个指针变量p,p指向数组a,定义函数fun,在fun内部访问数组,并打印出数组中各元 ...
- Touch事件分发源码解析
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 以下源码基于Gingerbread 2.3.7 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1.先看ViewGroup的di ...
- virtualenv与virtualenvwrapper的配置
virtualenv是用来创建python虚拟环境的一个工具(python的Scripts目录下virtualev.exe文件),virtualenvwrapper是用来 便于管理virtualenv ...
- [Linux] Configure iSCSI on Linux5 (both target and initiator)
********************************************************************************Target************** ...
- 2018网站Https升级完全攻略
这篇文章主要讲下HTTPs升级的全部流程,包括SSL/TLS证书获取,证书安装,网站调试(将站内http资源全部改为https+重定向等),升级成功后向谷歌webmaster和GA的重新提交新的网站. ...
- linux下C获取文件的大小
获取文件大小这里有两种方法: 方法一. 范例: unsigned long get_file_size(const char *path) { unsigned long filesize = -1; ...
- anytime
#include<stdio.h> #include<stdlib.h> #include<unistd.h> #include<sys/time.h> ...
- Python中字符串的处理方法
1.字符串 word = '字符串' sentence = "这是一个句子." paragraph = """这是一个段落, 可以由多行组成" ...
- webservice接口,用Soapui
webservice接口怎么测试呢,他不需要你在拼报文了,会给一个webservice的地址,或者wsdl文件,直接在soapui导入,就可以看到这个webservice里面的所有接口,也有报文,直接 ...
- 关于Unity3D使用时Scene视图清楚,Game视图不清楚的问题
1.自己不知道什么时候,将LowResolutioinAspectRatios给勾上了, 2.同样的Scale值大于1的时候也会造成模糊,但这个好像比1好发现一点