When testing the Kotlin, we need a main function entry that is the same as the Java language, so be careful how you create it.
Right-click
Select the File type when you create a new item here.When you click OK, you create a. kt file that basically has nothing but a package xx.Then enter main return, the final generated main function:
Fun Main (args:array
After generating the main function, we can create the class directly in the current. kt file
Preach Wisdom Blog Video tutorial Download summary |java video tutorial |net video tutorial |php video tutorial | Web video Tutorial
Preach Wisdom Blog Video tutorial Download summary |java video
* * A ball from the height of 100 meters free to fall, every time after landing back to the original height of half, and then fell, begging it in the 10th time when the ground, a total of how many meters. 10th time rebound How high here with
classGetprimenumber {/* * gets [1,n] interval primes */ FunForeachnumbergetprime (number:int): list {Valintegers = arraylist () for(Iinch1 until number)if(Isprimenumber (2, I)) Integers.add (i)returnintegers}/** * Gets the prime number from the
classPalindromenumber {/** * Creates a map collection to store the data and then makes a judgment throw on the data */Private ValPalindromedata= Hashmap> ()/** * Speak the numbers directly into a string and then use the middle intercept of the
/* Classical question: Every month from 3 months to have a pair of rabbits, the rabbit long to the third month after the birth of a pair of rabbits, if the rabbit is not dead, ask each month the total number of rabbits. Analysis: First of all, we
Definition and use of list
Fun Main (args:array) {
var namelist:mutablelist = ArrayList ()
namelist.add ("Xiaoming" );
Namelist.add ("Little Red");
Namelist.add ("Xiao Gang");
For ((Index,name) in Namelist.withindex ()) {
Return and = Flexible application
Example 1
Fun sum (a:int,b:int): int{
return a+b
}
Fun sum (a:int,b:int) = a + b
Example 2
Fun Max (A:int, b:int): Int {
if (a > B)
return a
else
return b
}
Fun Max (a:int, b:int) =
/* A ball from the height of 100 meters of freedom falling, each landing after jumping back to the original height of half, and then fall, to ask for it on the 10th landing, the total number of meters. The 10th rebound how high here with BigDecimal
/* If a number is exactly equal to the sum of its factors, this number is called the "end number". */classCompletenumber {private VarFirstfactornumber: Int = 0/** * Because the non-prime number can be calculated by multiplying by 1 9 in addition to 1
/* Each non-prime (composite) can be written as a number of primes (also known as prime numbers) in the form of multiplication, and these primes are called the composite's mass factor.
For example, 6 can be decomposed into 2x3, and 24 can be
/* Original question monkey divided peach: There are a bunch of peaches on the beach, there are five monkeys to divide. The first monkey divided the peaches into five parts, one more, and the monkey threw one more into the sea and took a copy. The
/* Print out all the "daffodils", the so-called "Narcissus number" refers to a three-digit number, whose numbers are cubic and equal to the number itself. For example: 153 is a "narcissus number", because the 153=1 three square +5 of the three
Link to the PHP object-oriented programming getting started tutorial, and the OOP Getting Started Tutorial. Link to the PHP object-oriented programming getting started tutorial, the OOP Getting Started Tutorial PHP official learning oop: php. netmanuzhoop5.intro. php the following link Source: blog.snsgou.compost-41.ht
is 1,0 is 0, as long as you are willing to pay the effort, mistakes will always disappear, the bug will always repair, and unlike the real world, many things people difficult to test, even if the hearts of the heart can be measured, There are times when you feel deeply powerless and helpless.No more nonsense, this is the first to share. The next blog will share some of the things that are versioned with GitHub on as, and some of the issues that are caused by the Gradle version when you import t
Destoon Introductory Tutorial example, Destoon Getting Started tutorial
Release time: 2014-06-23 Editor: www.jbxue.comCollect some Destoon introductory tutorials, Destoon examples, suitable for beginners to learn destoon basic tutorials and tips for getting started. Destoon Introductory Tutorials and tips examples
are Destoon basic tutorials, DESTOON®B2B website Management system is a set of Php+mysql-bas
Introduction to Public Platform development tutorial (graphic), Public introductory tutorial
Key word: Getting Started with public platform development
Author: C + + Lab
Background: The development of public platform requires a certain basic knowledge of PHP, PHP is an embedded HTML language, widely used in web development. There are two ways to transfer data between the server and the developer's server
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.