Forums Register Login

Exceptions

+Pie Number of slices to send: Send
hi vijayguptha Guptha
you came with fine answer
I have tried as you said
Thatis I have passed arguments like "java cbr 12 24" at runtime.
But i am getting another error NoClassdefinationFound exception in the below program
please tell me something for that.


import java.io.*;
class cbr
{
int a,b;
void read(int x,int y)
{
a=x;
b=y;
}
void swap(cbr x1)
{
int t=x1.a;
x1.a=x1.b;
x1.b=t;
}
void display()
{
System.out.println(a+" "+b);
}
public static void main(String []s)
{
cbr c=new cbr();
int a1=Integer.parseInt(s[0]);
int a2=Integer.parseInt(s[1]);
c.read(a1,a2);
System.out.println("Before swap");
c.display();
System.out.println("After swap");
c.swap(c);
c.display();
}
}
+Pie Number of slices to send: Send
 

error NoClassdefinationFound


please post the full text of the error message. There is a lot of useful info in the message.
+Pie Number of slices to send: Send
prans,

please CarefullyChooseOneForum. This has again nothing to do with I/O.

I urge you to start using the beginner's forum for these problems.
My previous laptop never exploded like that. Read this tiny ad while I sweep up the shards.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 991 times.
Similar Threads
Exceptions
exceptions
Interesting problem in Java with pass by reference
beginner
Exceptions
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 01:10:08.