Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
GeneralXP App Crash SendReport Sample Pin
Amber Star16-Feb-03 7:37
Amber Star16-Feb-03 7:37 
GeneralRe: XP App Crash SendReport Sample Pin
leppie16-Feb-03 9:28
leppie16-Feb-03 9:28 
GeneralRe: XP App Crash SendReport Sample Pin
Nick Parker17-Feb-03 1:45
protectorNick Parker17-Feb-03 1:45 
GeneralRe: XP App Crash SendReport Sample Pin
Richard Deeming17-Feb-03 3:21
mveRichard Deeming17-Feb-03 3:21 
GeneralRe: XP App Crash SendReport Sample Pin
leppie17-Feb-03 4:21
leppie17-Feb-03 4:21 
GeneralRe: XP App Crash SendReport Sample Pin
David Stone17-Feb-03 10:40
sitebuilderDavid Stone17-Feb-03 10:40 
GeneralRe: XP App Crash SendReport Sample Pin
leppie18-Feb-03 6:30
leppie18-Feb-03 6:30 
GeneralA small explanation needed Pin
sacoskun16-Feb-03 4:06
sacoskun16-Feb-03 4:06 
Hi everyone,I'm a newbie of C# and I want to ask the meaning of the line in a sample code.
Here is the code,

namespace HashExample {

// A library contains a list of books.
class Library {
public Hashtable bookList;
public Library() {
bookList = new Hashtable();
}
}

// Books are placed in the library
class Book {
public Book( string t, int n) {
Title = t; ISBN = n;
}
public string Title;
public int ISBN;
}

class ClassMain {
static void Main(string[] args) {
Book b1 = new Book("Programming Microsoft Windows with C#", 0735613702 );
Book b2 = new Book("Inside C#", 0735612889 );

Library myReferences = new Library();
myReferences.bookList.Add(b1.ISBN, b1);
myReferences.bookList.Add(b2.ISBN, b2);

Book b = (Book) myReferences.bookList[0735612889];
Console.WriteLine( b.Title );

Console.WriteLine("\nPress Enter to quit");
Console.ReadLine();
}
}
}
I understood the hash tables.However this line doesn't make any sense on me

Book b = (Book) myReferences.bookList[0735612889];

What is the function of "(Book)" here?What does this mean?

Kind Regards,


-
kromozom
-
GeneralRe: A small explanation needed Pin
Stephane Rodriguez.16-Feb-03 4:50
Stephane Rodriguez.16-Feb-03 4:50 
GeneralRe: A small explanation needed Pin
sacoskun16-Feb-03 11:43
sacoskun16-Feb-03 11:43 
GeneralRe: A small explanation needed Pin
Furty16-Feb-03 12:05
Furty16-Feb-03 12:05 
GeneralRe: A small explanation needed Pin
sacoskun16-Feb-03 20:19
sacoskun16-Feb-03 20:19 
GeneralMouse Point 's and Listboxes Pin
jtmtv1816-Feb-03 0:20
jtmtv1816-Feb-03 0:20 
GeneralRe: Mouse Point 's and Listboxes Pin
leppie16-Feb-03 1:15
leppie16-Feb-03 1:15 
GeneralRe: Mouse Point 's and Listboxes Pin
jtmtv1816-Feb-03 16:38
jtmtv1816-Feb-03 16:38 
GeneralCOM+!!!!!!!!!!!!! Pin
sss_dr16-Feb-03 0:07
sss_dr16-Feb-03 0:07 
GeneralHelp creating translucent MenuItems Pin
Mattingly15-Feb-03 23:39
Mattingly15-Feb-03 23:39 
GeneralBasic Flickering Problem Pin
Saren15-Feb-03 18:28
Saren15-Feb-03 18:28 
GeneralRe: Basic Flickering Problem Pin
leppie15-Feb-03 22:35
leppie15-Feb-03 22:35 
GeneralRe: Basic Flickering Problem Pin
Saren16-Feb-03 7:45
Saren16-Feb-03 7:45 
GeneralDelay in Application Run Pin
Sassan Komeili Zadeh15-Feb-03 17:55
Sassan Komeili Zadeh15-Feb-03 17:55 
GeneralRe: Delay in Application Run Pin
Nick Parker15-Feb-03 18:10
protectorNick Parker15-Feb-03 18:10 
GeneralRe: Delay in Application Run Pin
Sassan Komeili Zadeh16-Feb-03 9:15
Sassan Komeili Zadeh16-Feb-03 9:15 
GeneralSimple Windows App. HELP A GUY OUT! Pin
eggie515-Feb-03 17:33
eggie515-Feb-03 17:33 
GeneralRe: Simple Windows App. HELP A GUY OUT! Pin
eggie515-Feb-03 17:36
eggie515-Feb-03 17:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.