- 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
Krantik Chavan has Published 324 Articles
Krantik Chavan
407 Views
In order to export preferences to an XML file in Java, we need to use the exportSubtree() method. This method emits an XML document showing all of the preferences contained in this node and all of its descendants. This XML document provides an offline backup of the subtree rooted at ... Read More
Krantik Chavan
185 Views
To implement animation on max-height property with CSS, you can try to run the following code:ExampleLive Demo div { width: 350px; background-color: orange; ... Read More
Krantik Chavan
305 Views
In order to display the amount of free memory in the Java Virtual Machine, we use the freeMemory() method. It is a method of the java.lang.Runtime Class. It returns the amount of free memory in the Java Virtual Machine. If we call the gc method, there is a possibility of ... Read More
Krantik Chavan
3K+ Views
In order to get the number of available processors in Java, we use the availableProcessors() method. The java.lang.Runtime.availableProcessors() method returns the number of processors which are available to the Java virtual machine. This number may vary during a particular call of the virtual machine.Declaration − The java.lang.Runtime.availableProcessors() method is declared ... Read More
Krantik Chavan
506 Views
In order to roll a six sided die 6000 times in Java, we need to the nextInt() statement with decision making statements.The nextInt() method returns the next random integer value from this random number generator sequence.Declaration − The java.util.Random.nextInt() method is declared as follows −public int nextInt()Let us see a ... Read More
Krantik Chavan
179 Views
Elements can be filled in a long array using the java.util.Arrays.fill() method. This method assigns the required long value to the long array in Java. The two parameters required are the array name and the value that is to be stored in the array elements.A program that demonstrates this is ... Read More
Krantik Chavan
419 Views
In order to get the array upperbound of a multidimensional array, we use the length() method. For a 2D array, the length() method returns the number of rows. We can access the number of columns using the array_name[0].length method.Let us see a program to get the array upperbound in Java ... Read More
Krantik Chavan
89 Views
The java.lang.reflect.Array.newInstance(Class componentType, int length) method forms a new array with the component type and length as specified in the argumentsDeclaration − The java.lang.reflect.Array.newInstance(Class componentType, int length) method is declared as follows −public static Object newInstance(Class componentType, int length) throws IllegalArgumentException, NegativeArraySizeExceptionLet us see a program to create array with ... Read More
Krantik Chavan
178 Views
The runtime class of an object can be obtained using the java.lang.Object.getClass(). Also, the getName() method is used to get the name of the class.A program that demonstrates getting the class of an object using the getClass() method is given as follows −Example Live Demopublic class Demo { public static ... Read More
Krantik Chavan
252 Views
The interfaces that are implemented by an interface that is represented by an object can be determined using the java.lang.Class.getInterfaces() method. This method returns an array of all the interfaces that are implemented by the interface.A program that demonstrates this is given as follows −Example Live Demopackage Test; import java.lang.*; import ... Read More