Java Articles

Page 439 of 450

Is there any tool that can convert an XSD file to a Python class as JAXB does for Java?

Rajendra Dharmkar
Rajendra Dharmkar
Updated on 30-Jul-2019 1K+ Views

I would recommend generateDS for converting a XSD file to a Python class . In my opinion, it is a good tool for the said purpose.It (generatS) generates the Python class with all methods (setters and getters, export to XML, import from XML). It does a good job and works very well !.

Read More

Difference between HashMap and HashTable in Java.

Ankitha Reddy
Ankitha Reddy
Updated on 30-Jul-2019 21K+ Views

HashMap is non-syncronized and is not thread safe while HashTable is thread safe and is synchronized. HashMap allows one null key and values can be null whereas HashTable doesn't allow null key or value. HashMap is faster than HashTable. HashMap iterator is fail-safe where HashTable iterator is not fail-safe. HashMap extends AbstractMap class where HashTable extends Dictionary class.

Read More

How to avoid Java code in jsp page?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 317 Views

You can use JSTL, JSP Standard Tag Library or EL, Expression Language to avoid scriptlets.

Read More

How do we compare String in Java

Giri Raju
Giri Raju
Updated on 30-Jul-2019 300 Views

https://www.tutorialspoint.com/javaexamples/string_compare.htm

Read More

When to use LinkedList over ArrayList in Java

Paul Richard
Paul Richard
Updated on 30-Jul-2019 3K+ Views

LinkedList should be used where modifications to a collection are frequent like addition/deletion operations. LinkedList is much faster as compare to ArrayList in such cases. In case of read-only collections or collections which are rarely modified, ArrayList is suitable.

Read More

Which one is faster Array or List in Java

Moumita
Moumita
Updated on 30-Jul-2019 941 Views

The array is faster in case of access to an element while List is faster in case of adding/deleting an element from the collection.

Read More

Why can't static method be abstract in Java?

radhakrishna
radhakrishna
Updated on 30-Jul-2019 2K+ Views

A static method belongs to class not to object instance thus it cannot be overridden or implemented in a child class. So there is no use of making a static method as abstract.

Read More

Difference between declaring a variable before or in a Java loop.

Giri Raju
Giri Raju
Updated on 30-Jul-2019 173 Views

Performance wise, there is hardly any difference. But it is good to keep a variable local to the scope it is used. So declaring a variable inside Java loop is generally preferred.

Read More

How to concatenate byte array in java?

mkotla
mkotla
Updated on 30-Jul-2019 3K+ Views

You ByteArrayOutputStream to write byte arrays and get the result using its toByteArray() method.import java.io.ByteArrayOutputStream; import java.io.IOException; public class Tester { public static void main(String[] args) throws IOException { byte[] a = { 1,2,3}; byte[] b = { 4,5,6}; ByteArrayOutputStream baos = new ByteArrayOutputStream(); baos.write(a); baos.write(b); byte[] c = baos.toByteArray(); for(int i=0; i< c.length ; i++){ System.out.print(c[i] +" "); } } }Output1 2 3 4 5 6

Read More

Why java is both compiled and interpreted language.

Jai Janardhan
Jai Janardhan
Updated on 30-Jul-2019 906 Views

Yes, a java program is first compiled into bytecode which JRE can understand. ByteCode is then interpreted by the JVM making it as interpreted language.

Read More
Showing 4381–4390 of 4,495 articles
« Prev 1 437 438 439 440 441 450 Next »
Advertisements