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/ 里面的好东西很多,以自然语 ...
随机推荐
- Django content_type 简介及其应用
在网上看到 django ORM 有一个 content_type 字段表的应用,这张表不是我们通过建立model类添加的,而是django自动帮我们生成的,具体的作用先简单的举个例子给大家介绍一下. ...
- 中国地图插件世界地图||jQuery矢量SVG地图插件JVectorMap
中国地图插件|jQuery矢量SVG地图插件JVectorMap https://www.html5tricks.com/jquery-china-map.html 世界地图: https://www ...
- shell脚本实现git和svn统计log代码行
实现的功能 git 根据传入的三个参数:起始统计日期.结束统计日期.git仓库地址. 脚本统计的是git仓库内的所有分支的log信息. 脚本统计的是指定时间段内.每一个提交人指定的git地址的所有分支 ...
- Java并发编程阅读笔记-锁和活跃性问题
- Struts中的匹配规则
<constant name="struts.action.extension" value="action,do,htm"/> 表示之后后缀名为a ...
- Idea中:No converter found for return value of type: class java.util.ArrayList:Json格式转换问题
1.在搞SSM框架的时候,前端发送请求后,显示如下错误. @ResponseBody注解进行返回List<对象>的json数据时出现 nested exception is java.la ...
- python学习笔记:2.python基础
4.27 01,pycharm 安装使用. 011,昨日内容回顾. 编译型: 将代码一次性全部编译成二进制,然后运行. 优点:执行效率高. 缺点 ...
- python的标识符
1.在pyhon中,标识符由字母.数字.下划线组成 2.在python中,所有标识符可以有字幕,下划线开头,但不能以数字开头 3.python的标识符是区分大小写的 4.以下划线开头的标识符是有特殊意 ...
- 学号 20175223 《Java程序设计》第 5 周学习总结
目录 教材学习内容总结 教材学习中的问题和解决过程 1. 在 jdb 调试时使用命令行参数. 代码调试中的问题和解决过程 1. 在jdb调试时通过命令行传入参数 2. "可能尚未初始化变量& ...
- matlab json文件解析 需要下载一个jsonlab-1.5
% facebookX24.m clc; addpath('C:\Program Files\MATLAB\R2015b\toolbox\jsonlab-1.5'); % read .json jso ...