This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | |
} |