Windows programming

Moderators: None (Apply to moderate this forum)
Number of threads: 3670
Number of posts: 9122

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Permutation using java Posted by bhenl on 13 Feb 2009 at 9:40 AM
I have this class called Permutation,and a test of it called PermutaionTest...but I try to run it it gives me an error:Exception in thread "main"java.lang.NoClassDefFoundError:test

What could be the problem??Kindly help.
Thank you


public class Permutation
{
public void permuteString(String beginningString, String endingString)
{
if(endingString.length()<=1)
System.out.println(beginningString+endingString);
else
{
for(int i=0; i<endingString.length(); i++)
{
try
{
String newString=endingString.substring( 0, i)+ endingString.substring ( 1+1);

permuteString(beginningString+endingString.charAt(i), newString);
}
catch ( StringIndexOutOfBoundsException exception)
{
exception.printStackTrace();
}
}
}
}
}


import java.util.Scanner;

public class PermutationTest
{
public static void main( String args[])
{
Scanner scanner= new Scanner(System.in);
Permutation permutationObject= new Permutation();

System.out.print("enter a string: ");

String input=scanner.nextLine();

permutationObject.permuteString("", input);
}
}



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.