Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

What method is used to create a daemon thread in Java?

What method is used to create a daemon thread in Java?
Answered on 4th Jan, 2018, 0 Views

The setDaemon() method of the Thread class is used to mark/set a particular thread as either a daemon thread or a user thread. The Java Virtual Machine exits when the only threads running are all daemon threads. This method must be called before the thread is started. Example: , Output: ,

How to open a plain text file in Java?

How to open a plain text file in Java?
Answered on 4th Jan, 2018, 0 Views

You can access a plain text using the File class. Live Demo , ,

How to create a Directory recursively using Java?

How to create a Directory recursively using Java?
Answered on 4th Jan, 2018, 0 Views

The java.io.File.mkdirs() creates the directory named by this abstract pathname, together with necessary and non-existent parent directories. Live Demo , ,

What is the difference between Serialization and Deserialization in Java?

What is the difference between Serialization and Deserialization in Java?
Answered on 4th Jan, 2018, 0 Views

 Java provides a mechanism, called object serialization where an object can be represented as a sequence of bytes that includes the object's data as well as information about the object's type and the types of data stored in the object. Example ,  After a serialized object has been written into a file, it can be read from the file and Deserialized that is, the type information and.....

How to check if a file exists or not in Java?

How to check if a file exists or not in Java?
Answered on 4th Jan, 2018, 0 Views

The File class provides exists() method this returns true if a file in the specified path exists else it returns false. Live Demo , ,

What is the try block in Java?

What is the try block in Java?
Answered on 4th Jan, 2018, 0 Views

A try/catch block is placed around the code that might generate an exception. Code within a try/catch block is referred to as protected code, and the syntax for using try/catch looks like the following – , The code which is prone to exceptions is placed in the try block. When an exception raised inside a try block, instead of terminating the program JVM stores the exception details in.....

Is it necessary that a try block should be followed by a catch block in Java?

Is it necessary that a try block should be followed by a catch block in Java?
Answered on 4th Jan, 2018, 0 Views

Not necessarily catch, a try must be followed by either catch or finally block. , ,

How to convert string to array of integers in java?

How to convert string to array of integers in java?
Answered on 3rd Jan, 2018, 0 Views

You can convert a String to integer using the parseInt() method of the Integer class. To convert a string array to an integer array, convert each element of it to integer and populate the integer array with them.  Live Demo , ,

How to switch data from an array to array list in java?

How to switch data from an array to array list in java?
Answered on 3rd Jan, 2018, 0 Views

The Arrays class of the java.util package provides you a method named asList(). This method accepts an array (of objects) and converts them into a list and returns it. Live Demo , ,

How to pass Arrays to Methods in Java?

How to pass Arrays to Methods in Java?
Answered on 3rd Jan, 2018, 0 Views

You can pass arrays to a method just like normal variables. When we pass an array to a method as an argument, actually the address of the array in the memory is passed (reference). Therefore, any changes to this array in the method will affect the array. Suppose we have two methods min() and max() which accepts an array and these methods calculates the minimum and maximum values of the.....

loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.