This file contains hidden or 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 List { | |
public void add(){ | |
} | |
public int get() { | |
} | |
} | |
class Stack { |
This file contains hidden or 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 List { | |
public void add(){ | |
} | |
public int get() { | |
} | |
} | |
class Stack extends List{ |
This file contains hidden or 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 BookDB { | |
BookPersist bookPersist; | |
public void save(Book book) { | |
bookPersist.save(book); | |
} | |
} | |
interface BookPersist { | |
public void save(Book book); | |
} |
This file contains hidden or 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 BookDB { | |
public void save(Book book) { | |
try { | |
FileWriter fw = new FileWriter("books.txt"); | |
fw.write(book.getTitle() + "-" + book.getAuthor()); | |
fw.close(); | |
} catch (Exception e) { | |
System.out.println(e); | |
} | |
System.out.println("Success..."); |
This file contains hidden or 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
package com.dnivra26; | |
interface Time { | |
public void setTime(); | |
public int getTime(); | |
} | |
interface Alarm { | |
public void setAlarm(); |
This file contains hidden or 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
public interface Clock { | |
public void setTime(); | |
public int getTime(); | |
public void setAlarm(); | |
public void getAlarm(); | |
public void setRadio(); | |
public void getRadio(); | |
} | |
class AlarmClock implements Clock{ |
This file contains hidden or 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
public class Rectangle { | |
int width; | |
int height; | |
public Rectangle(int width, int height) { | |
this.width = width; | |
this.height = height; | |
} | |
public void setWidth(int width) { |
This file contains hidden or 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
package com.dnivra26; | |
abstract class Vehicle { | |
abstract public int findAir(); | |
} | |
class Auto extends Vehicle { | |
public int getFrontTyreAir() { | |
return frontTyreAir; |
This file contains hidden or 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
package com.dnivra26; | |
class Auto { | |
public int getFrontTyreAir() { | |
return frontTyreAir; | |
} | |
public int getBackLeftTyreAir() { | |
return backLeftTyreAir; |
This file contains hidden or 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
import java.io.FileWriter; | |
public class Blog { | |
String title = "Microservices"; | |
String author = "Feynmann"; | |
public String getTitle() { | |
return title; | |
} |
NewerOlder