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
package com.company; | |
import java.util.List; | |
import java.util.ArrayList; | |
interface Graphic { | |
//Prints the graphic. | |
public void print(); | |
} |
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
package com.company; | |
import java.util.ArrayList; | |
interface Shape{ | |
void draw(String fillColor); | |
} | |
class Square implements Shape{ |
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
package com.company; | |
interface Coffee{ | |
Double getCost(); | |
String getIngredients(); | |
} | |
class SimpleCoffee implements Coffee { | |
@Override |
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
// | |
// CurrentWeatherViewController.swift | |
// betterment | |
// | |
// Created by Mitul Manish on 29/04/2016. | |
// Copyright © 2016 Mitul Manish. All rights reserved. | |
// | |
// | |
// ViewController.swift |
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 CoreDataInverseRelationSaveExample { | |
@IBAction func saveNewSkill(sender: UIBarButtonItem) { | |
print("finding User") | |
let fetchRequest = NSFetchRequest(entityName: "Person") | |
fetchRequest.predicate = NSPredicate(format: "%K == %@", "userID", CURRENT_USER) | |
//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
interface Switch { | |
void turnOn(); | |
} | |
interface Appliance { | |
void run(); | |
} | |
class TV implements Appliance { |
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
package com.company; | |
enum Country | |
{ | |
UnitedStates, Spain, Greece, UK | |
} | |
interface Currency { | |
String symbol(); | |
String code(); |
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
interface DoorCommand { | |
String execute(); | |
} | |
class Door { | |
String doorName; | |
public Door(String doorName) { |
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
import java.util.ArrayList; | |
import java.util.List; | |
interface Item { | |
String name(); | |
Packing packing(); | |
int price(); | |
} | |
interface Packing { |
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
let twoDimArr: [[Int]] = [[0, 0, 1], [1, 0, 1]] | |
for (i,row) in twoDimArr.enumerate() { | |
for (j, cell) in row.enumerate() { | |
print("m[\(i),\(j)] = \(cell)") | |
print("**************") | |
} | |
} |
OlderNewer