Skip to content

Instantly share code, notes, and snippets.

View NitinPraksash9911's full-sized avatar
🎯
Focusing

Nitin Prakash NitinPraksash9911

🎯
Focusing
View GitHub Profile
class TestViewModel @Inject constructor(private val dataRepo: DataRepository) : ViewModel() {
private var dataLiveData = MutableLiveData<Int>()
fun insertUser(user: User) {
dataRepo.insertUser(user)
}
fun deleteUser() {
class Book {
val name: String = ""
val price: Int = 0;
val author: String = ""
}
class BookStocks:Book {
val no_of_books: Int = 0;
}
public interface Car {
void turnOnEngine();
void accelerate();
}
public class MotorCar implements Car {
private Engine engine;
public class ElectricCar implements Car {
public void turnOnEngine() {
throw new AssertionError("I don't have an engine!");
}
public void accelerate() {
//this acceleration is crazy!
}
}
public interface Car {
void accelerate();
}
public interface EngineType {
void turnOnEngine();
}
/***********************/
interface Robot {
fun reset()
fun fly()
fun talk()
}
class ButterflyRobot : Robot {
override fun reset() {
TODO("not implemented")
interface Robot {
fun reset()
}
interface Flyable {
fun fly()
}
interface Talkable {
fun talk()
enum OutputDevice {PRINTER, DISK}
public fun copy(OutputDevice dev){
val c:int
while((c=readKeyBoard)!=EOF){
if(dev==PRINTER)
{
writePrinter(c)
}else{
writeToDisk(c)
interface Reader {
fun read():Char
}
interface Writer {
fun write(ch Char)
}
public fun copy(r Reader, w Writer ){
var ch Char