User:Alexsmail/Computer programming/Object oriented/Examples/Card

From Wikibooks, open books for an open world
Jump to navigation Jump to search
public class Card {
	private String name;
	private int value;
	
	public Card(String name, int value){
		this.name = name;
		this.value = value;
	}
	
	public String getName(){
		return name;
	}
	
	public int getValue(){
		return value;
	}
	
	public static void main(String[] args) {
		Card c = new Card("ten of peak", 10);
		System.out.println("The card is "+c.getName());
		System.out.println("The card value is "+c.getValue());
		System.out.println();
		
		
	}

}