Skip to content

Instantly share code, notes, and snippets.

View lu911's full-sized avatar
🎯
Focusing

Seungchan Yuk lu911

🎯
Focusing
View GitHub Profile
@lu911
lu911 / SeqMethods.scala
Last active December 20, 2015 21:09
seq method test
object Main {
def main(args: Array[String]): Unit = {
new SeqMethods()
}
}
class SeqMethods {
private val digits = Seq(1,3,5,7)
private val chars = Seq("a", "b", "c", "d", "a", "c", "b")
@lu911
lu911 / iterable.scala
Last active December 20, 2015 21:09
Iterable method test
object Main {
def main(args: Array[String]): Unit = {
new IteratorMethods()
}
}
class IteratorMethods(){
private val iterable = Iterable(1,2,3,4,5)
val methods = List(method)
@lu911
lu911 / set_method.scala
Last active December 20, 2015 21:09
Set method test
object Main {
def main(args: Array[String]): Unit = {
new SetMethods()
}
}
class SetMethods {
private val digits = Set(1,3,5,7)
@lu911
lu911 / collection.scala
Last active December 20, 2015 20:59
Scala Collection
import scala.collection.mutable.ArrayBuffer
import scala.collection.mutable.LinkedList
import scala.collection.mutable.BitSet
import java.util.LinkedHashSet
object Main {
def main(args: Array[String]): Unit = {
new Collection()
}
}
@lu911
lu911 / application-object.scala
Created August 3, 2013 05:10
Application object
import scala.collection.mutable.ArrayBuffer
/*
object Main {
def main(args: Array[String]): Unit = {
}
}
*/
@lu911
lu911 / inner-class.scala
Created August 3, 2013 05:06
Inner class
import scala.collection.mutable.ArrayBuffer
object Main {
def main(args: Array[String]): Unit = {
val n1 = new Network
val n2 = new Network
val loup = n1.join("loup")
val bob = n2.join("bob")
@lu911
lu911 / companion-object.scala
Created August 3, 2013 04:57
companion object
object Main {
def main(args: Array[String]): Unit = {
val p1 = Person.apply("Loup")
val p2 = Person("Loup")
}
class Person(val id: Int, val name: String)
{
println("Hello " + name)
@lu911
lu911 / constructor.scala
Created August 3, 2013 04:39
constructor
object Main {
def main(args: Array[String]): Unit = {
val p1 = new Person("Loup", 19)
}
class Person(val name: String, val age: Int)
{
println("Hello " + name + "(" + age + ")")
}
@lu911
lu911 / assistance-constructor.scala
Created August 3, 2013 04:35
Assistance Constructor
object Main {
def main(args: Array[String]): Unit = {
val p1 = new Person
val p2 = new Person("Loup")
val p3 = new Person("Loup", 19)
}
class Person
{
@lu911
lu911 / private-field.scala
Created August 3, 2013 04:29
Private Field
object Main {
def main(args: Array[String]): Unit = {
val test = new Test;
test.increment()
test.isLess(new Test());
test.print();
}
class Test