Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
(they r transmitted as
bytecodes).
* servlet is a special type of java application that that runs on the server and
can be called by a client usually a web browser.in servlet the code for the
application runs inside server.no special plugins are required for the browser.
* public static void main()//public means the main method can be accessed by other
classes.static keyword means that other classes can access the main method
directly without using an object.void means that the method doesnt return any
values.
* string can contain letters,digitsand special characters like *,# and &.
* all the threads in java including the ones thats running and others that are
eligible to be running,are in "runnable" state.
* start method changes the state of the thread from new to runnable.
* for creating a new thread,do 1)create a class that extends the class thread.
2)overload the method run() to perform the desired task. 3)create a thread by
instantiating an object from the class. 4)call the start method of the thread
object.
* sleep() is a static function of thread class that is used to move the thread to
blocked state for a specified number of milliseconds.eg:thread.sleep(500);
* when a thread is created, its given a priority value between 1 and 10.where 10
is the highest priority and 1 lowest.
* by default every thread is given the priority of the thread that created it.a
thread create from main thread is given priority 5.
* wait() palces the current thread in waiting state until another thread calls the
notify or notifyall method to current object.it releases lock on current object so
that other threads can execute synchronised methods.
* notifyall method wakesup all of the threads that are waiting for currnt object's
lock.
* i/o in java is built on streams. input streams read data. output streams write
data.filter streams can be chained to either an input stream or an output stream.
filters can modify the data as it's read or written—for instance, by encrypting or
compressing it—or they can simply provide additional methods for converting the
data that's read or written into other formats.
* the println( ) methods do the same thing, but they also append a platform-
dependent line separator character to the end of the line they write. this is a
linefeed (\n) on unix, a carriage return (\r) on the mac, and a carriage
return/linefeed pair (\r\n) on windows.
reverse name resolution means that for any ip address, the host associated with
the ip address is returned.
* closing a serversocket frees a port on the local host, allowing another server
to bind to the port; closing a socket breaks the connection between the local and
the remote hosts.
* a class can implement more than one interface.by contrast, a class can only
inherit a single superclass (abstract or otherwise).