method bodies. An interface can also contain fields, but An interface says:
“This is what all classes that implement this particular interface will look
like.” Thus, any code that uses a particular interface knows what methods
might be called for that interface, and that’s all. So the interface is used to
establish a “protocol” between classes.
How to make application thread-safe ?
You should use the word synchronized to mark the critical section of code.
You may also use other methods of thread synchronization (see wait(),
notify(), notifyAll() etc.
What do you know about networking support in Java ?
Java supports “low-level” and “high-level” classes. “Low-level” classes
provide support for socket programming: Socket, DatagramSocket, and
provide support for socket programming: Socket, DatagramSocket, and
ServerSocket classes. “High-level” classes provide “Web programming”:
URL, URLEncoder, and URLConnection classes. Networking
programming classes ease the programming of network applications, but do
not substitute your knowledge of networking. Java networking like
anything else in Java is platformindependent.
What are the problems faced by Java programmers who don’t use layout
managers?
Without layout managers, Java programmers are faced with determining
how their GUI will be displayed across multiple windowing systems and
finding a common sizing and positioning that will work within the
constraints imposed by each windowing system.
What are the two basic ways in which classes that can be run as threads
may be defined?
A thread class may be declared as a subclass of Thread, or it may
Do'stlaringiz bilan baham: |