Skip to content

Instantly share code, notes, and snippets.

View ronsc's full-sized avatar

Ronnakorn Jannnalao ronsc

View GitHub Profile
@ronsc
ronsc / Collar.java
Created October 23, 2013 08:37
แบบฝึกหัดหน้า 81 ข้อ 5
public class Collar {
private String color;
private int price;
Collar(String color) {
this.color = color;
this.price = 200;
}
public String getColor() {
@ronsc
ronsc / Cat.java
Last active December 26, 2015 07:19
แบบฝึกหัดหน้า 81 ข้อ 4
public class Cat{
Cat() {
System.out.println("I'm a cat");
}
}
@ronsc
ronsc / Dog.java
Created October 23, 2013 08:12
แบบฝึกหัดหน้า 81 ข้อ 3
public class Dog {
private String name;
Dog(String name) {
this.name = name;
}
public void bite(Student s) {
System.out.println(this.name + " bites " + s.getName());
}
@ronsc
ronsc / No2.java
Created October 23, 2013 08:02
แบบฝึกหัดหน้า 80 ข้อ 2
public class No2 {
public static void main(String[] args) {
People p1 = new People("John");
People p2 = new People("Jack", 30);
System.out.println(p1.getName() + " is " + p1.getAge() + " years old.");
System.out.println(p2.getName() + " is " + p2.getAge() + " years old.");
}
}
@ronsc
ronsc / No1.java
Created October 23, 2013 07:52
แบบฝึกหัดหน้า 80 ข้อ 1
public class No1 {
public static void main(String[] args) {
Robot r = new Robot();
r.calculate(2);
r.calculate(5);
r.calculate(8);
}
}
package oot.lab5.group1.jacket;
public class Arm {
private String color;
public Arm(String color){
this.color = color;
}
import java.util.Scanner;
public class Lab32 {
public static int fac(int n){
if(n == 0)
return 1;
else
return n * fac(n - 1);
}