Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Object Oriented Programming Articles
Page 578 of 589
Which one is faster Array or List in Java
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 MoreWhy can't static method be abstract in Java?
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 MoreDifference between declaring a variable before or in a Java loop.
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 MoreHow to concatenate byte array in java?
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 MoreWhy java is both compiled and interpreted language.
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 MoreRegular Expressions syntax in Java Regex
Following is a simple program demonstrating how to use regular expression in Java. Java Regex Characters
Read MoreWhat is the package for String Class in Java?
String class belongs to the java.lang package.
Read MoreIs StringBuffer final in Java?
Yes, StringBuffer class is final Java. We cannot override this class.
Read MoreWhy we do not import a package while we use any string function?
The String class belongs to the java.lang package. This is the default package of the Java language therefore it is not mandatory to import it to use its classes.
Read More