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/ 里面的好东西很多,以自然语 ...
随机推荐
- MySQL— 索引,视图,触发器,函数,存储过程,执行计划,慢日志,分页性能
一.索引,分页性能,执行计划,慢日志 (1)索引的种类,创建语句,名词补充(最左前缀匹配,覆盖索引,索引合并,局部索引等): import sys # http://www.cnblogs.com/w ...
- lr_java user协议脚本开发
1.准备工作,安装jdk,配置环境变量 lr11 jdk1.6 32位 lr12 jdk1.7 32位 注:若原已安装了jdk1.8,现要安装jdk1.7,若遇到安装好1.7并配置好环境后,在cmd中 ...
- spring cloud config svn仓库配置
之前快速入门了一下spring cloud config 但是仓库用的别人博客上的git仓库,公司用的是svn项目管理中心,下面这个自己配置的时候出现的错误 You need to configure ...
- Java 面试题集锦
都是一些非常非常基础的题,是我最近参加各大IT公司笔试后靠记忆记下来的,经过整理献给与我一样参加各大IT校园招聘的同学们,纯考Java基础功底,老手们就不用进来了,免得笑话我们这些未出校门的孩纸们,但 ...
- awk shell
作业一:整理博客,内容包含awk.变量.运算符.if多分支 awk 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 ...
- Android:JNI强化训练
一.前言 Java本机接口(Java Native Interface (JNI))是本机编程接口,它是JDK的一部分,JNI它提供了若干的API,实现了和Java和其他通信(主要是C&C++ ...
- mpeg2文件分析(纯c解析代码)
参考链接: 1. MPEG-2码流结构分析 https://www.cnblogs.com/CoderTian/p/9246225.html(本文语法采用这里的截图,代码原创) 1. mpeg2的码流 ...
- Spring MVC流程
这是spring mvc框架结构图,图片是很早在网上撸过来的,具体在哪忘了…… 早期学习Springmvc 并没有具体了解过,只知道这样用很爽,最近了解下基本结构流程及组件所在…… 执行流程 Spri ...
- 查询数据库:models.Books.objects.all()[10: 20]与models.Books.objects.filter(id__gt=10, id__lt=20).values() 的区别
1. models.Books.objects.all()[10: 20] (10:20 之间是冒号,不是逗号.)查出的是 QuerySet对象,如需进行操作,得进一步进行剥皮. 查询代码: 查询结 ...
- Java NStruct
package org.rx.bean; import org.rx.Lazy; import org.rx.SystemException; import java.io.Serializable; ...