Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Exceptions  RSS feed

 
prans rao
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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();
}
}
 
Norm Radder
Ranch Foreman
Posts: 2240
28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
error NoClassdefinationFound

please post the full text of the error message. There is a lot of useful info in the message.
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!