benkas Posted December 4, 2007 at 04:53 PM Report Share #152248 Posted December 4, 2007 at 04:53 PM ois!!! Alguem sabe como se lista as palavras de 1ficheiro e as respectivas linhas?Tipo: Dados os ficheiros IntCell.java e TestCell.java a linha de comando $ java Identificadores TestIntCell.java IntCell.java deve produzir o seguinte resultado: IntCell.java IntCell: 5, 11, 18 initialValue: 18-19 read: 25 storedvalue: 19, 26, 33, 35 write: 31 x: 33 TestIntCell.java IntCell: 6 String: 4 System: 9 TestIntCell: 2 args: 4 m: 6, 8-9 out: 9 println: 9 read: 9 write: 8 Link to comment Share on other sites More sharing options...
magician Posted December 4, 2007 at 05:12 PM Report Share #152258 Posted December 4, 2007 at 05:12 PM Simples lês linha a linha fazes um split por espaços para separar as palavras e depois é ver que palavras lá estão e guardar o numero da linha, para isso pode criar um Java Bean tipo Palavra em que leva a palavra e um vector com os números das linhas em que essa palavra aparece. I haven’t lost my mind; it’s backed up on DVD somewhere! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now