1 2 3 4 5 6 > >>   Sort: Date

Creating a New Thread
How to create a thread in a program? You have two ways to do so. First, making your class "extends" Thread class. Second, making your class "implements" Runnable interface. Put jobs in a run() method and call start() method to start the thread.
2016-06-25, 434733👍, 8💬

💬 2016-06-25 Ron: You can also create an anonymous class and run it: Thread t = new Thread() { public void run() { // do whatever you want } }; t....

💬 2013-10-02 drinkin: This unmistakably created an audience for books fact that consciously offered the grand design models

💬 2013-07-23 XRumerTest: Hello. And Bye.

(More comments ...)

Java String Interview Question
If we have the following in a Java code: String s="abc"; String s2="abc"; Then what will be output of: System.out.println("s.equals(s 2)= "+s.equals(s2)); System.out.println("s==s2 = "+(s==s2)); The correct answer is: s.equals(s2) = true s==s2 = true The following answer is wrong. Because both liter...
2016-06-26, 14487👍, 2💬

💬 2011-01-25 FYIcenter.com: Hi Kevin, Thanks. Answer updated.

💬 2011-01-17 Kevin McLain: This answer is wrong! String literals are interned by the VM this both will print true

How does one iterate through items and records in a specified block?
How does one iterate through items and records in a specified block? One can use NEXT_FIELD to iterate (loop) through items in a specific block and NEXT_RECORD to iterate through records in a block. Code example: OriPos := TO_NUMBER(:System.Trigger_Reco rd);First_Record; LOOP -- do processing IF (:S...
2011-03-22, 9685👍, 0💬

System.setOut() - Setting Standard Console Output to
How could Java classes direct program messages to the system console, but error messages, say to a file? The class System has a variable out that represents the standard output, and the variable err that represents the standard error device. By default, they both connected to the system console. But...
2007-03-03, 8087👍, 0💬

What are some advantages and disadvantages of Java Sockets
What are some advantages and disadvantages of Java Sockets? Advantages of Java Sockets: Sockets are flexible and sufficient. Efficient socket based programming can be easily implemented for general communications. Sockets cause low network traffic. Unlike HTML forms and CGI scripts that generate and...
2007-11-13, 8044👍, 0💬

Multi-Threading
How does multi-threading take place on a computer with a single CPU? The operating system's task scheduler allocates execution time to multiple tasks. By quickly switching between executing tasks, it creates the impression that tasks execute sequentially.
2007-03-03, 8000👍, 0💬

Troubleshooting NullPointerException
What is NullPointerException and how to handle it? When an object is not initialized, the default value is null. When the following things happen, the NullPointerException is thrown: Calling the instance method of a null object. Accessing or modifying the field of a null object. Taking the length of...
2007-03-03, 7994👍, 0💬

System.loadLibrary() - Loading DLL for JNI Interface
An application needs to load a library before it starts to run, how to code? One option is to use a static block to load a library before anything is called. For example, class Test { static { System.loadLibrary("myApp.dll" );} .... } When you call new Test(), the static block will be called first b...
2007-03-03, 7982👍, 0💬

What Is Thread
What is thread? A thread is an independent path of execution in a system.
2007-03-03, 7955👍, 0💬

Wha is the output from System.out.println("Hello"+null);?
Wha is the output from System.out.println("Hello"+nul l);?Hellonull
2023-08-24, 7786👍, 1💬

💬 2023-08-24 DIMITRI: THIS IS GOOD

ASCII, Unicode, UTF-8 and UTF-16
How many bits are used to represent Unicode, ASCII, UTF-16, and UTF-8 characters? Unicode requires 16 bits and ASCII require 7 bits. Although the ASCII character set uses only 7 bits, it is usually represented as 8 bits. UTF-8 represents characters using 8, 16, and 18 bit patterns. UTF-16 uses 16-bi...
2007-03-03, 7378👍, 0💬

Synchronization Premitives on EJB Methods
Should synchronization primitives be used on overrided bean methods? No. The EJB specification specifically states that the enterprise bean is not allowed to use thread primitives. The container is responsible for managing concurrent access to beans at runtime.
2009-11-05, 7290👍, 0💬

List of Waiting Threads on an Object
Can each Java object keep track of all the threads that want to exclusively access to it?
2007-03-03, 7128👍, 0💬

Locking Objects for Exclusive Use
Can Java object be locked down for exclusive use by a given thread? Yes. You can lock an object by putting it in a "synchronized" block. The locked object is inaccessible to any thread other than the one that explicitly claimed it.
2007-03-03, 6988👍, 0💬

What Is Finalization
What is the purpose of finalization? The purpose of finalization is to give an unreachable object the opportunity to perform any cleanup processing before the object is garbage collected.
2007-03-03, 6965👍, 0💬

J2SDK 1.5 and J2SDK 5.0
What's the difference between J2SDK 1.5 and J2SDK 5.0? There is no difference, Sun Microsystems just re-branded this version.
2007-03-03, 6927👍, 0💬

Clone of Map Objects
Jack developed a program by using a Map container to hold key/value pairs. He wanted to make a change to the map. He decided to make a clone of the map in order to save the original data on side. What do you think of it? If Jack made a clone of the map, any changes to the clone or the original map w...
2007-03-03, 6912👍, 0💬

Anonymous Classes
Can an anonymous class be declared as implementing an interface and extending a class? An anonymous class may implement an interface or extend a superclass, but may not be declared to do both.
2007-03-03, 6820👍, 0💬

Well-Written Object Oriented Programs
What does a well-written Object Oriented program look like? A well-written object oriented program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance.
2007-03-03, 6808👍, 0💬

What Is invokeLater() Method
When should the method invokeLater() be used? This method is used to ensure that Swing components are updated through the event-dispatching thread.
2007-03-03, 6791👍, 0💬

States of a Thread
What are the high-level thread states? The high-level thread states are ready, running, waiting, and dead.
2007-03-03, 6572👍, 0💬

Order of Exception Catch Clauses
Does it matter in what order catch statements for FileNotFoundException and IOExceptipon are written? Yes, it does. The FileNoFoundException is inherited from the IOException. Exception's subclasses have to be caught first.
2007-03-03, 6539👍, 0💬

wait(), notify() and notifyAll() Methods
What is the purpose of the wait(), notify(), and notifyAll() methods? The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
2007-03-03, 6495👍, 0💬

Invoking run() Method of a Thread
What invokes a thread's run() method? After a thread is started, via its start() method of the Thread class, the JVM invokes the thread's run() method when the thread is initially executed.
2007-03-03, 6469👍, 0💬

1 2 3 4 5 6 > >>   Sort: Date