JAVA Beginners part 18

Client and Server Model – how to establish connection to the server – how to send messages to the server – how to receive messages from the server Socket chatSocket = new Socket(“196.164.1.103”,5000); 196.164.1.103 address of the sever 5000 is the port number server / TCP port numbers ftp/20 telnet/23 smtp/25 time/37 https/443 pop3/110 http/80 […]

JAVA Beginners part 17

How to save data in a Java program. a) use serialization if the programs that use the saved data are Java b) write a plain text file Steps to save an object through serialization. FileOutputStream filestream = new FileOutputStream(“mygame.ser”); this will create a file ObjectOutputStream os = new ObjectOutputStream(filestream); this lets you to create objects, […]

JAVA Beginners part 15

Java Sound ——— 1)get a sequencer sequencer player = midisystem.getsequencer(); 2)make a new sequence sequence seq = new sequence(timing,4); 3)get a new track track t = seq.createTrack(); 4)fill in the track with midievents t.add(mymidievent1); player.setsequence(seq); the actual instructions of a song is held in the message. setmessage(144,1,44,100) 144 says the message type, on or off […]