当前位置: 首页 > news >正文

丽水专业网站建设哪家好seo优化自动点击软件

丽水专业网站建设哪家好,seo优化自动点击软件,前端seo主要优化哪些,网站设计与程序方向基本类型 声明变量 val(value的简写)用来声明一个不可变的变量,这种变量在初始赋值之后就再也不能重新赋值,对应Java中的final变量。 var(variable的简写)用来声明一个可变的变量,这种变量在初始…

基本类型

在这里插入图片描述

声明变量

在这里插入图片描述
val(value的简写)用来声明一个不可变的变量,这种变量在初始赋值之后就再也不能重新赋值,对应Java中的final变量。
var(variable的简写)用来声明一个可变的变量,这种变量在初始赋值之后仍然可以再被重新赋值,对应Java中的非final变量。

类型自动推导

kotlin还能对我们的声明的变量进行类型的自动推导:
在这里插入图片描述

易混淆的Long类型标记

在这里插入图片描述

Kotlin的数值类型转换

在这里插入图片描述

无符号类型

目的是为了兼容C
在这里插入图片描述

Kotlin的字符串

在这里插入图片描述


fun main() {var a = 2val b = "Hello Kotlin"//    val c = 12345678910l // compile error.val c = 12345678910L // okval d = 3.0 // Double, 3.0f Floatval e: Int = 10//val f: Long = e // implicitness not allowedval f: Long = e.toLong() // implicitness not allowedval float1: Float = 1fval double1 = 1.0val g: UInt = 10uval h: ULong = 100000000000000000uval i: UByte = 1uprintln("Range of Int: [${Int.MIN_VALUE}, ${Int.MAX_VALUE}]")println("Range of UInt: [${UInt.MIN_VALUE}, ${UInt.MAX_VALUE}]")val j = "I❤️China"println("Value of String 'j' is: $j") // no need bracketsprintln("Length of String 'j' is: ${j.length}") // need bracketsSystem.out.printf("Length of String 'j' is: %d\n", j.length)val k = "Today is a sunny day."val m = String("Today is a sunny day.".toCharArray())println(k === m) // compare references.println(k == m) // compare values.val n = """<!doctype html><html><head><meta charset="UTF-8"/><title>Hello World</title></head><body><div id="container"><H1>Hello World</H1><p>This is a demo page.</p></div></body></html>""".trimIndent()println(n)
}

public class JavaBasicTypes {public static void main(String... args) {int a = 2;final String b = "Hello Java";long c = 12345678910l; // ok but not good.long d = 12345678910L; // okint e = 10;long f = e; // implicit conversion// no unsigned numbers.String j = "I❤️China";System.out.println("Value of String 'j' is: " + j);System.out.println("Length of String 'j' is: " + j.length());System.out.printf("Length of String 'j' is: %d\n",  j.length());String k = "Today is a sunny day.";String m = new String("Today is a sunny day.");System.out.println(k == m); // compare references.System.out.println(k.equals(m)); // compare values.String n = "<!doctype html>\n" +"<html>\n" +"<head>\n" +"    <meta charset=\"UTF-8\"/>\n" +"    <title>Hello World</title>\n" +"</head>\n" +"<body>\n" +"    <div id=\"container\">\n" +"        <H1>Hello World</H1>\n" +"        <p>This is a demo page.</p>\n" +"    </div>\n" +"</body>\n" +"</html>";System.out.println(n);}
}

数组Array

数组的创建

数组的长度

在这里插入图片描述

数组的读写

数组的遍历

在这里插入图片描述

数组的包含关系


fun main() {val a = IntArray(5)println(a.size) //same with the Collections(e.g. List)val b = ArrayList<String>()println(b.size)val c0 = intArrayOf(1, 2, 3, 4, 5)val c1 = IntArray(5){ 3 * (it + 1) } // y = 3*(x + 1)println(c1.contentToString())val d = arrayOf("Hello", "World")d[1] = "Kotlin"println("${d[0]}, ${d[1]}")val e = floatArrayOf(1f, 3f, 5f, 7f)for (element in e) {println(element)}e.forEach {println(it)}if(1f in e){println("1f exists in variable 'e'")}if(1.2f !in e){println("1.2f not exists in variable 'e'")}}
import java.util.ArrayList;public class JavaArrays {public static void main(String... args) {int[] a = new int[5];System.out.println(a.length);// only array use 'length'ArrayList<String> b = new ArrayList<>();System.out.println(b.size());int[] c = new int[]{1, 2, 3, 4, 5};String[] d = new String[]{"Hello", "World"};d[1] = "Java";System.out.println(d[0] + ", " + d[1]);float[] e = new float[]{1, 3, 5, 7};for (float element : e) {System.out.println(element);}for (int i = 0; i < e.length; i++) {System.out.println(e[i]);}// Test in an Arrayfor (float element : e) {if(element == 1f){System.out.println("1f exists in variable 'e'");break;}}//Test not in an Arrayboolean exists = false;for (float element : e) {if(element == 1.2f){exists = true;break;}}if(!exists){System.out.println("1.2f not exists in variable 'e'");}}
}

区间

区间的创建

闭区间

在这里插入图片描述

开区间

在这里插入图片描述

倒序区间

在这里插入图片描述

区间的步长

在这里插入图片描述

区间的迭代

在这里插入图片描述

区间的包含关系

在这里插入图片描述

区间的应用

在这里插入图片描述

fun main() {val intRange = 1..10 // [1, 10]val charRange = 'a'..'z'val longRange = 1L..100Lval floatRange = 1f .. 2f // [1, 2]val doubleRange = 1.0 .. 2.0println(intRange.joinToString())println(floatRange.toString())val uintRange = 1U..10Uval ulongRange = 1UL..10ULval intRangeWithStep = 1..10 step 2val charRangeWithStep = 'a'..'z' step 2val longRangeWithStep = 1L..100L step 5println(intRangeWithStep.joinToString())val intRangeExclusive = 1 until 10 // [1, 10)val charRangeExclusive = 'a' until 'z'val longRangeExclusive = 1L until 100Lprintln(intRangeExclusive.joinToString())val intRangeReverse = 10 downTo 1 // [10, 9, ... , 1]val charRangeReverse = 'z' downTo 'a'val longRangeReverse = 100L downTo 1Lprintln(intRangeReverse.joinToString())for (element in intRange) {println(element)}intRange.forEach {println(it)}if (3.0 !in doubleRange) {println("3 in range 'intRange'")}if (12 !in intRange) {println("12 not in range 'intRange'")}val array = intArrayOf(1, 3, 5, 7)for (i in 0 until array.size) {println(array[i])}for(i in array.indices){println(array[i])}
}

集合框架

在这里插入图片描述

集合框架的接口类型对比

在这里插入图片描述

集合框架的创建

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

集合实现类复用与类型别名

在这里插入图片描述

集合框架的读写和修改

在这里插入图片描述

在这里插入图片描述
在这里插入图片描述

Pair

在这里插入图片描述
在这里插入图片描述

Triple

在这里插入图片描述

fun main() {val intList: List<Int> = listOf(1, 2, 3, 4)val intList2: MutableList<Int> = mutableListOf(1, 2, 3, 4)val map: Map<String, Any> =mapOf("name" to "benny", "age" to 20)val map2: Map<String, Any> =mutableMapOf("name" to "benny", "age" to 20)val stringList = ArrayList<String>()for (i in 0 .. 10){stringList.add("num: $i")}for (i in 0 .. 10){stringList += "num: $i"}for (i in 0 .. 10){stringList -= "num: $i"}stringList[5] = "HelloWorld"val valueAt5 = stringList[5]val hashMap = HashMap<String, Int>()hashMap["Hello"] = 10println(hashMap["Hello"])//    val pair = "Hello" to "Kotlin"
//    val pair = Pair("Hello", "Kotlin")
//
//    val first = pair.first
//    val second = pair.second
//    val (x, y) = pairval triple = Triple("x", 2, 3.0)val first = triple.firstval second = triple.secondval third = triple.thirdval (x, y, z) = triple}
import java.util.*;public class JavaCollections {public static void main(String... args) {List<Integer> intList = new ArrayList<>(Arrays.asList(1, 2, 3, 4));List<String> stringList = new ArrayList<>();for (int i = 0; i < 10; i++) {stringList.add("num: " + i);}for (int i = 0; i < 10; i++) {stringList.remove("num: " + i);}stringList.set(5, "HelloWorld");String valueAt5 = stringList.get(5);HashMap<String, Integer> hashMap = new HashMap<>();hashMap.put("Hello", 10);System.out.println(hashMap.get("Hello"));}
}

函数

有自己的类型,可以赋值、传递,并再合适的条件下调用

函数的定义

在这里插入图片描述
在这里插入图片描述

函数vs方法

在这里插入图片描述

函数的类型

在这里插入图片描述

函数的引用

函数的引用类似C语言的函数指针,可用于函数传递
在这里插入图片描述
在这里插入图片描述
由于类型可以自动推断,所以可以不用写类型名
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

变长参数

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

多返回值

默认参数

在这里插入图片描述
在这里插入图片描述

具名参数

在这里插入图片描述

package com.bennyhuo.kotlin.builtintypes.functionsfun main(vararg args: String) {println(args.contentToString())val x:(Foo, String, Long)->Any = Foo::barval x0: Function3<Foo, String, Long, Any> = Foo::bar// (Foo, String, Long)->Any = Foo.(String, Long)->Any = Function3<Foo, String, Long, Any>val y: (Foo, String, Long) -> Any = xval z: Function3<Foo, String, Long, Any> = xyy(x)val f: ()->Unit = ::fooval g: (Int) ->String = ::fooval h: (Foo, String, Long)->Any= Foo::barmultiParameters(1, 2, 3, 4)defaultParameter(y = "Hello")val (a, b, c) = multiReturnValues() //伪val r = a + bval r1 = a + c}fun yy(p: (Foo, String, Long) -> Any){//p(Foo(), "Hello", 3L)
}class Foo {fun bar(p0: String, p1: Long): Any{ TODO() }
}fun foo() { }
fun foo(p0: Int): String { TODO() }fun defaultParameter(x: Int = 5, y: String, z: Long = 0L){TODO()
}fun multiParameters(vararg ints: Int){println(ints.contentToString())
}fun multiReturnValues(): Triple<Int, Long, Double> {return Triple(1, 3L, 4.0)
}

案例:四则计算器

/*** input: 3 * 4*/
fun main(vararg args: String) {if(args.size < 3){return showHelp()}val operators = mapOf("+" to ::plus,"-" to ::minus,"*" to ::times,"/" to ::div)val op = args[1]val opFunc = operators[op] ?: return showHelp()try {println("Input: ${args.joinToString(" ")}")println("Output: ${opFunc(args[0].toInt(), args[2].toInt())}")} catch (e: Exception) {println("Invalid Arguments.")showHelp()}
}fun plus(arg0: Int, arg1: Int): Int{return arg0 + arg1
}fun minus(arg0: Int, arg1: Int): Int{return arg0 - arg1
}fun times(arg0: Int, arg1: Int): Int{return arg0 * arg1
}fun div(arg0: Int, arg1: Int): Int{return arg0 / arg1
}fun showHelp(){println("""Simple Calculator:Input: 3 * 4Output: 12""".trimIndent())
}

文章转载自:
http://ruckle.rbzd.cn
http://perennially.rbzd.cn
http://cardcarrier.rbzd.cn
http://hypersurface.rbzd.cn
http://assaultive.rbzd.cn
http://elision.rbzd.cn
http://maudlin.rbzd.cn
http://inkslinging.rbzd.cn
http://incross.rbzd.cn
http://april.rbzd.cn
http://thetford.rbzd.cn
http://dermatozoon.rbzd.cn
http://pollinate.rbzd.cn
http://unexcited.rbzd.cn
http://ptolemaic.rbzd.cn
http://stephanotis.rbzd.cn
http://reradiate.rbzd.cn
http://zucchini.rbzd.cn
http://noncontradiction.rbzd.cn
http://suds.rbzd.cn
http://reincorporate.rbzd.cn
http://thermometry.rbzd.cn
http://bryophyte.rbzd.cn
http://gadgety.rbzd.cn
http://whisky.rbzd.cn
http://gummiferous.rbzd.cn
http://minty.rbzd.cn
http://gust.rbzd.cn
http://engild.rbzd.cn
http://expedient.rbzd.cn
http://distilled.rbzd.cn
http://bagged.rbzd.cn
http://merlon.rbzd.cn
http://prunella.rbzd.cn
http://exsection.rbzd.cn
http://donghai.rbzd.cn
http://wrangler.rbzd.cn
http://encoignure.rbzd.cn
http://democratic.rbzd.cn
http://cosh.rbzd.cn
http://benfactress.rbzd.cn
http://ilici.rbzd.cn
http://deflection.rbzd.cn
http://oda.rbzd.cn
http://windsock.rbzd.cn
http://valour.rbzd.cn
http://factionalism.rbzd.cn
http://patrol.rbzd.cn
http://memomotion.rbzd.cn
http://margaric.rbzd.cn
http://bobber.rbzd.cn
http://causality.rbzd.cn
http://peribolos.rbzd.cn
http://haystack.rbzd.cn
http://grouchy.rbzd.cn
http://horridly.rbzd.cn
http://chalet.rbzd.cn
http://nonsensical.rbzd.cn
http://muttnik.rbzd.cn
http://deconsecrate.rbzd.cn
http://kymry.rbzd.cn
http://cornerer.rbzd.cn
http://diversified.rbzd.cn
http://leathercoat.rbzd.cn
http://laureation.rbzd.cn
http://rabbah.rbzd.cn
http://nymphlike.rbzd.cn
http://saditty.rbzd.cn
http://fortepiano.rbzd.cn
http://catholicness.rbzd.cn
http://auburn.rbzd.cn
http://prizeman.rbzd.cn
http://uninquisitive.rbzd.cn
http://brewer.rbzd.cn
http://mio.rbzd.cn
http://cenotaph.rbzd.cn
http://cytomembrane.rbzd.cn
http://litten.rbzd.cn
http://wistful.rbzd.cn
http://lincolnite.rbzd.cn
http://assistance.rbzd.cn
http://trice.rbzd.cn
http://headwear.rbzd.cn
http://maiger.rbzd.cn
http://piggin.rbzd.cn
http://hypsometry.rbzd.cn
http://cavernous.rbzd.cn
http://algin.rbzd.cn
http://unclutter.rbzd.cn
http://agitational.rbzd.cn
http://thermalgesia.rbzd.cn
http://dpt.rbzd.cn
http://howdie.rbzd.cn
http://motorola.rbzd.cn
http://pileum.rbzd.cn
http://unbred.rbzd.cn
http://chastise.rbzd.cn
http://nonjuror.rbzd.cn
http://entrechat.rbzd.cn
http://jainism.rbzd.cn
http://www.15wanjia.com/news/93265.html

相关文章:

  • 阿里云服务器建立网站吗热搜词排行榜
  • 网站收费板块怎么做网络营销案例分析论文
  • 做网站首页googleseo排名公司
  • wordpress 微站网络宣传推广方案
  • 黄金网站大全免费2023微信管理系统平台
  • 银川网站建设公司哪家不错查网址
  • 营销网站建设方案互联网运营推广
  • 做企业网站10万起步网站打开速度优化
  • 微网站建设的第一步是进行首页的设置中国局势最新消息今天
  • 网站建设小故事培训班
  • 备案网站名称怎么写个人推广软文300字范文
  • 桂林做网站广州网站优化步骤
  • 网站富文本的内容怎么做搜索引擎优化趋势
  • 怎么建立一个邮箱天津seo网站推广
  • 学校网站建设目的外包公司什么意思
  • magento怎么做b2b网站青岛seo整站优化
  • 福州市台江区网站做网站的费用
  • 做网站的生产方式青岛关键词排名哪家好
  • 做豆腐交流经验的网站职业培训机构需要什么资质
  • 注销备案号 网站郑州网站制作选择乐云seo
  • wordpress整合百度站内搜索餐饮管理培训课程
  • 建设公司加盟seo管家
  • 网站做什么内容赚钱企业软文代写
  • dw中用php做网站搜盘 资源网
  • 做cra需要关注的网站网络营销专业学什么
  • 金融网站框架模板下载安装怎么制作链接网页
  • ps做网站的效果图汽车软文广告
  • 婚礼网站怎么做网站建设排名优化
  • 做网站必须要文网文吗千锋教育出来好找工作吗
  • 苏州建设网站电商平台怎么加入