Operators
These allow you to perform certain operations on your data. There are 3 basic types:

  1. Unary: operates on 1 operand
  2. Binary: operates on 2 operands
  3. 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的更多相关文章

  1. 30行代码搞定WCF并发性能测试

    [以下只是个人观点,欢迎交流] 30行代码搞定WCF并发性能 轻量级测试. 1. 调用并发测试接口 static void Main()         {               List< ...

  2. 30行代码让你理解angular依赖注入:angular 依赖注入原理

    依赖注入(Dependency Injection,简称DI)是像C#,java等典型的面向对象语言框架设计原则控制反转的一种典型的一种实现方式,angular把它引入到js中,介绍angular依赖 ...

  3. 30行代码实现Javascript中的MVC

    从09年左右开始,MVC逐渐在前端领域大放异彩,并终于在刚刚过去的2015年随着React Native的推出而迎来大爆发:AngularJS.EmberJS.Backbone.ReactJS.Rio ...

  4. Tensorflow快餐教程(1) - 30行代码搞定手写识别

    版权声明:本文为博主原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/lusing/article/details ...

  5. 10分钟教你用python 30行代码搞定简单手写识别!

    欲直接下载代码文件,关注我们的公众号哦!查看历史消息即可! 手写笔记还是电子笔记好呢? 毕业季刚结束,眼瞅着2018级小萌新马上就要来了,老腊肉小编为了咱学弟学妹们的学习,绞尽脑汁准备编一套大学秘籍, ...

  6. JAVA_SE基础——30.构造代码块

    黑马程序员入学blog...构造代码块作用:给所有的对象进行统一的初始化. 问题:要求每个小孩出生都会哭,这份代码有两个构造函数,如果需要每个小孩出生都要哭的话,那么就需要在不同的构造函数中都调用cr ...

  7. 30天代码day3 Intro to Conditional Statements

    Boolean A logical statement that evaluates to true or false. In some languages, true is interchangea ...

  8. 30 行代码实现 JS 中的 MVC

    一连串的名字走马观花式的出现和更迭,它们中一些已经渐渐淡出了大家的视野,一些还在迅速茁壮成长,一些则已经在特定的生态环境中独当一面舍我其谁.但不论如何,MVC已经并将持续深刻地影响前端工程师们的思维方 ...

  9. 30行代码消费腾讯人工智能开放平台提供的自然语言处理API

    腾讯人工智能AI开放平台上提供了很多免费的人工智能API,开发人员只需要一个QQ号就可以登录进去使用. 腾讯人工智能AI开放平台的地址:https://ai.qq.com/ 里面的好东西很多,以自然语 ...

随机推荐

  1. 微信小程序开发学习(一):开发前准备

    开发前准备 Step1:注册 微信小程序开放平台: https://mp.weixin.qq.com/cgi-bin/wx 开发者注册: https://mp.weixin.qq.com/wxopen ...

  2. servlet(3)

    常见的网络访问后缀: - .html : 网页 - .htm : 网页 - .php : php技术实现的动态网页 - .jsp : Java Server pages Java代码+HTML代码实现 ...

  3. python修炼第二天

    第二天的课程还是塞得满满的,一天下来充实也疲惫.那天听出金星师傅嗓子有些沙哑,想必是讲课说话太多导致.啥也不说了.唯有努力练功方可回报! 1 序: 今天主要是详细学习了绝大部分的数据类型,字符编码,边 ...

  4. JavaScript中事件委托(事件代理)详解

    在JavaScript的事件中,存在事件委托(事件代理),那么什么是事件委托呢? 事件委托在生活中的例子: 有三个同事预计会在周一收到快递.为签收快递,有两种办法:一是三个人在公司门口等快递:二是委托 ...

  5. idea的一般使用和初始配置

    ----- idea的一般使用和配置 1.java的类注释及方法注释 :https://blog.csdn.net/sikefeng/article/details/80557265 类注释模板 /* ...

  6. canal-client无法获取数据

    在虚拟机单cpu环境下 canal.properties配置中 #canal.instance.parser.parallelThreadSize = 16 那么,MysqlMultiStageCop ...

  7. emacs技巧

    Table of Contents "ctrl space"设置mark 同时在选中的各行行首添加相同内容 寄存器 跳转到某行 删除光标所在的空格和TAB或空白行 把TAB全部转换 ...

  8. 命令行运行Android Robotium自动化用例或单元测试用例

    本文目录 1.运行所有的测试用例 2.运行单个测试类或某个TestSuite 3.运行某个测试类里面的某个测试方法 4.运行两个不同的测试类或类中的方法 命令行运行Android Robotium自动 ...

  9. python简单爬虫 用beautifulsoup爬取百度百科词条

    目标:爬取“湖南大学”百科词条并处理数据 需要获取的数据: 源代码: <div class="basic-info cmn-clearfix"> <dl clas ...

  10. 【一:定义】python 简介

    [python基础介绍的比较好的link] https://www.liaoxuefeng.com/wiki/001374738125095c955c1e6d8bb493182103fac927076 ...