Skip to content

Instantly share code, notes, and snippets.

View lekeCoder's full-sized avatar
🏠
Working from home

Adeola Adeleke lekeCoder

🏠
Working from home
  • Nigeria
View GitHub Profile
@lekeCoder
lekeCoder / switch_ex_3.java
Created April 28, 2022 21:50
Switch vs When example 3
// execute all label expression that is valid
int day = 3;
switch(day){
case 1:
case 2:
case 3:
System.out.println("Wednesday is workday");
case 4:
case 5:
System.out.println("Work day");
@lekeCoder
lekeCoder / switch_ex_2.java
Created April 28, 2022 20:54
switch vs when example 2
// combined case blocks support
// print whether a day is a working day or weekends based on day number (1 - 7)
int day = 3;
switch(day){
case 1:
case 2:
case 3:
case 4:
case 5:
System.out.println("Work day");
@lekeCoder
lekeCoder / switch_ex_1.java
Last active April 28, 2022 22:15
switch and when example 1
// print day of the week based on day number (1 - 7)
int day = 3;
switch(day){
case 1:
System.out.println("Monday");
break;
case 2:
System.out.println("Tuesday");
break;
case 3:
@lekeCoder
lekeCoder / native_ads_view_holder.kt
Created November 25, 2021 22:06
implement native ads in a multi view holder infinite scrolling list using paging
class NativeAdViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView){
private val adsArr = listOf("native ads id here 1", "native ads id here 2", "native ads id here 3")
private var adsCnt = 3
init {
loadAds()
}