- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Sharon Christine has Published 433 Articles
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
72 Views
The sort(Object[]) method of the java.util.Arrays class sorts the specified array of Objects into ascending order according to the natural ordering of its elements.Exampleimport java.util.Arrays; public class ArrayDemo { public static void main(String[] args) { Object ob[] = {27, 11, 44}; for (Object ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
326 Views
The HTML5 tag is used to draw graphics, animations, etc. using scripting. It is a new tag introduced in HTML5. To use images with HTML5 canvas, use the drawImage() method. This method draws the given image onto the canvas.You can try to run the following code to learn how ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
161 Views
The instanceof operator is used only for object reference variables. The operator checks whether the object is of a particular type (class type or interface type).Examplepublic class Test { public static void main(String args[]) { String name = "James"; boolean result = name instanceof String; System.out.println(result); } }Outputtrue
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
248 Views
The isAlive() method of the Thread class returns true if the thread is alive, which is anytime after the thread has been started but before it runs to completion.Exampleclass first implements Runnable { public void run() { try { for(int i=0; i
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
1K+ Views
You can get the size of a directory with the help of FileUtils.sizeofDirectory(File Name) method of FileUtils class.Exampleimport java.io.File; import org.apache.commons.io.FileUtils; public class Main { public static void main(String[] args) { long size = FileUtils.sizeOfDirectory(new File("C:/Windows")); System.out.println("Size: " + size + " ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
1K+ Views
The println() terminates the current line by writing the line separator string. The print() method just prints the given content.ExampleLive Demopublic class Sample { public static void main(String args[]) { System.out.println("Hello"); System.out.println("how are you"); System.out.print("Hello"); System.out.print("how are ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
295 Views
The throw keyword is used to raise an exception explicitly.Examplepublic class Test { public static void main(String[] args) { throw new NullPointerException(); } }Exception in thread "main" java.lang.NullPointerException at a6.dateAndTime.Test.main(Test.java:5)The throws keywords in Java used to postpone the handling of a checked exception.public class Test ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
3K+ Views
You can convert a double array to a string using the toString() method. To convert a double array to a string array, convert each element of it to string and populate the String array with them.ExampleLive Demoimport java.util.Arrays; public class DoubleArrayToString { public static void main(String args[]) { ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
2K+ Views
To move an element from one position to other (swap) you need to –Create a temp variable and assign the value of the original position to it.Now, assign the value in the new position to original position.Finally, assign the value in the temp to the new position.ExampleLive Demoimport java.util.Arrays; public ... Read More
![Sharon Christine](https://www.tutorialspoint.com/assets/profiles/13517/profile/60_82215-1512649681.jpg)
Sharon Christine
295 Views
You can declare an array just like a variable −int myArray[];You can create an array just like an object using the new keyword −myArray = new int[5];You can initialize the array by assigning values to all the elements one by one using the index −myArray [0] = 101; myArray [1] ... Read More