What is the use of toarray () in java?
Answer / Srijan Chaubey
The toArray() method in Java is used to convert a collection into an array. It returns an array containing all of the elements in this collection, or a subset if the collection implements the RandomAccess interface and a partial view is requested.
| Is This Answer Correct ? | 0 Yes | 0 No |
Why declare Main() method as a static in java ?
What is an object in java and how is it created?
String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?
What's the base class in java from which all classes are derived?
explain me with a code snippet about the generation and handling of null point exceptions.
Which browsers work with java?
public class Test { public static void main(String[] args) { int countA = 0; int countB = 0; int countC = 0; int countD = 0; int countE = 0; int countF = 0; int countG = 0; int countH = 0; int countI = 0; int countJ = 0; int countK = 0; int countL = 0; int countM = 0; int countN = 0; int countO = 0; int countP = 0; int countQ = 0; int countR = 0; int countS = 0; int countT = 0; int countU = 0; int countV = 0; int countW = 0; int countX = 0; int countY = 0; int countZ = 0; } } Can anybody tell me any alternate solution(like loop or something) to automate this initialization process. Ex:- for(char chr='A';chr<='Z'; chr++) { (int) String "count"+chr = 0; }
Nested classes VS Inner classes?
abstract class Demo { public void show() { System.out.println("Hello I am In show method of Abstract class"); } } class Sample extends Demo { public void show() { super.show(); System.out.println("Hello I am In Sample "); } } public class Test { public static void main(String[] args) { //I WANT TO CALL THE METHOD OF BASE CLASS IT IS POSSIBLE OR NOT CAN WE USE SCOPE RESOLUTION OPERATOR TO CALL OR JAVA NOT SUPPORTED THAT :: OPERATORE } }
What is the difference between static (class) method and instance method?
What are Encapsulation, Polymorphism and Inheritance?
What is an example of a boolean?