Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

manoj kushwaha

Greenhorn
+ Follow
since Jul 12, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by manoj kushwaha

String [][] argCopy = new String[2][2];


I agrre with you Gokul. In above declaration argCopy is an array object that contains array of String. Now argCopy[i] contains reference of some array of String. Here according to declaration it is containing references to two arrays of length 2.

now

int x;
x = args.length;
for(int y=0;y<x;y++)
{
argCopy[0][y] = args[y];
System.out.println(" " + argCopy[0][y]);
}



Here the program will work if length of array args is 2 or less than 2, but, if length of array args is greater than 2 then ArrayIndexOutOfBoundsException exception will occur.

If there is any mistake please correct me.
Hi Friends!
I am also palanning to give SCJP1.4 Exam in next month. I am also willing to join your group.
I know hoe to get objects from arraylist and also if there is hashpmap object i can print its ky-value pair. but having both togather is creating problem to me... I think i need use nested iterate but not able to do that.
15 years ago
Hi,
I am trying to display both key and value of Hashmap objects that are contained in Arraylist.
Does anybody know how to do that???
15 years ago
It is working
thank you very much.
I was looking for the answer for so many days nad asked so many person. thanks again
Hi!
I have created two packages a and b and placed two classes A and B in them respectably.
Class files are as follows

file A.java.........

package a;
public class A
{
public void hello()
{
System.out.println("hello");
}
}

file B.java.........

package b;
import a.A;
class B
{
public static void main(String args[])
{
A a=new A();
a.hello();
}
}


above program is compiling without any error but when i am trying to run it, its giving following Exception

Exception in thread "main" java.lang.NoClassDefFoundError: B (wrong name: b/B)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I have checked my classpath variable also but not getting the root of problem.
please help me out....