Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 90 additions & 1 deletion data/kotlin.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,33 @@
{
"definition": "ক্যারেকটার",
"code": "val c: Char = ‘s’"
},
{
"definition": "বহু লাইনের স্ট্রিং যুক্তকরন",
"code": "val text = \"\"\"\n|First Line\n|Second Line\n|Third Line \"\"\".trimMargin()"
},
{
"definition": "সাব স্ট্রিং করুন",
"code": "substr = str.substring(8..13)"
}



]
},
{
"title": "কন্ট্রোল ফ্লো",
"items": [{
"items": [
{
"definition": "সাধারন if-else",
"code": "if(condition) { ... } else { ... }"
},

{
"definition": "মাল্টিপল কন্ডিশন ",
"code": "if (score in 0..1000) { }"
},

{
"definition": "when যেটি গতানুগতিক switch এর বিকল্প হিসেবে ব্যাবহার করা হয়",
"code": "when (x) {\n 1 -> print(\"x == 1\")\n 2 -> print(\"x == 2\")\n else -> {\n print(\"x is neither 1 nor 2\")\n }\n}"
Expand Down Expand Up @@ -94,6 +112,77 @@
"definition": "লেট স্কোপ ফাংশন ,নাল চেক করার জন্য ",
"code": " mediaString?.let { media ->\n\t//do your opeartion you want to do on mediaString object.But use \"media\" in stead of mediaString. It is an alternative of \"if(mediaString != null){}\" in java\n}"
}]
},

{
"title": "টারনারি অপারেশনস",
"items": [ {
"definition": "টারনারি অপারেশন ",
"code": "val numOfTypes = if (x > 5) x > 5 else x <= 5"
}]
},
{
"title": "বিটওয়াইজ অপারেশনস",
"items": [
{
"definition": "এন্ড অপারেশন ",
"code": "val andResult = a and b"
},
{
"definition": "অর অপারেশন ",
"code": "val orResult = a or b"
},
{
"definition": "এক্স অর অপারেশন ",
"code": "val orResult = a xor b"
},
{
"definition": "রাইট শিফট ",
"code": "a shr 2"
},
{
"definition": "লেফট শিফট ",
"code": "a shl 2"
},
{
"definition": "আনসাইনড রাইট শিফট ",
"code": "a ushr 2"
}

]
},
{
"title": "টাইপ চেক এবং কাস্টিং",
"items": [
{
"definition": "টাইপ চেক ",
"code": "var age = object as? AgeData // var age = object as AgeData?"
},
{
"definition": "টাইপ চেক ( implicit ) ",
"code": "if ( object is age ) { var age = object } // smart casting"
}

]
},
{
"title": "আর্গুমেন্ট পাস ও মেথড ডাটা রিটার্ন ",
"items": [
{
"definition": "ভ্যারয়েবল নাম্বার অফ আর্গুমেন্টস ",
"code": "fun doSomething(vararg numbers: Int) { }"
},
{
"definition": "সিঙ্গেল এক্সপ্রেশন ফাংশন ",
"code": "fun getAge(): Int = age "
},
{
"definition": "সিঙ্গেল এক্সপ্রেশন ফাংশন আরো সিম্পলভাবে",
"code": "fun getAge() = age // return-type is Int "
}

]
}

]
}