Blankets_McGee Blankets_McGee - 5 months ago 63
Java Question

Data Mining Strings

Hey guys I was wondering if I could get some help with something. I have a java class which just contains a severly long string (it's text from a website but stored in u006e values and such) I am creating a data mining class and was just wondering how to reference the string so that i can test things like the length and count refrences to numbers and stuff like that? the actual class is and the actual code is:

public class Text
* A very long String, containing text from a web site.
public static final String TEXT;

TEXT = //this is where the extremely long string is composed of u006c/u006e and so on

I have tried


i am fairly new to Java so i might not be going about it correctly but here is just the start of my datamining class

public class DataMiner
* Main Method, or main point of entry in the Java application.
* @param args not used
public static void main(String[] args)
System.out.printf("The total length of input lines are: ", Text.length());

here i was just looking to tell me how ling the lines of input are within the other class. Any help is appreciated.


For a quick fix try this

System.out.printf("The total length of input lines are: %d \n", Text.length());

However better would be to create a method on Text called length that returns TEXT.length() or simply change to Text.TEXT.length() - Personally I would use the first choice and have TEXT as a private field