2013年8月22日

java 核心概念题

摘要: 1. What is immutable object? Can you write immutable object?for example : String.For an object to be immutable, there has to be no way to change fields, mutable or not, and to access fields that are mutable.Here is an example of a mutable object.import java.util.ArrayList;import java.util.LinkedList 阅读全文

posted @ 2013-08-22 09:29 brave_bo 阅读(307) 评论(0) 推荐(0)

OOP clothing store

摘要: Design Clothing store using OOP concepts. based on your design tell how you'll find if the store has XXL size of a particular shirt.package OOP.clothstore;import java.util.ArrayList;import java.util.Hashtable;class cloth{String brand;String barCode;Type type;Size size;enum Size{xs,s,m,l,xl,xxl}; 阅读全文

posted @ 2013-08-22 02:51 brave_bo 阅读(241) 评论(0) 推荐(0)

OOP Train & reservation system

摘要: import java.util.ArrayList;import java.util.Hashtable;class station{String stationID;}class Train{String trainID;int numOfCars;int maxCapacity;int NumOfPassenger;float price;Hashtable schedule;//time, station}public class trainReservation {//id, trainHashtable trains = new Hashtable ();float reserv. 阅读全文

posted @ 2013-08-22 02:47 brave_bo 阅读(150) 评论(0) 推荐(0)

导航