Core Java (6529)
Advanced Java (552)
Swing (223)
EJB (402)
Java Networking (49)
Hibernate (1009)
Spring Framework (1486)
Java J2EE AllOther (116) 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; }
2335MY code is: public class P1{
public static void main(String ar[])
{
class.forName("java.lang.String");
}
}
errors i got are :New.java:5: error:
Can we declare a static variable inside a method?
Can you explain the directory structure for a struts folder in brief ?
What is the difference between system.out ,system.err and system.in?
What is the file extension you use for hibernate mapping file?
What are the benefits of Struts framework?
Can we overload the methods by making them static?
What is default locale java?
What are types of dependency injection?
What is jpanel swing?
Where import statement is used in a java program?
What is main method in java?
Which messaging modes are included in the java messaging service jms )?
What is final keyword?
How do you declare a string variable?
What is statement and preparedstatement in java?