| |
| |
| |
|
Page: 1 2 3 4 5 6
Comments:
<0> I have a String[] tempString Array <0> In that Array I have an InputString Value containing a 'sentence' followed by a URL <0> I want to store the 'sentence' and the 'URL address' into two separate array. <0> In doing so, I'm getting this error. <1> so did you make those two new arrays with size of current array? <1> tempString.length or something <0> I sure did. <1> well where are you trying to use -1 as index?? <0> int splitNumber = tempString[k].lastIndexOf("http://"); <1> heh.. well if http:// isnt there, it returns - <1> -1 <0> description[k] = new String(tempString[k].substring(0,splitNumber)); <1> so do that if (splitNumber != -1) <0> ok. <0> if my Input is ..... <0> help out help come in http://www.yahoo.com
<1> should find http:// <0> It should make an Array[] of {help out help come in}; <1> im telling you -1 is returned where there aint no such substring in indexOf <0> Hmmm.... <0> I see. <1> println each string and see <1> why <0> Well it should get the Index of http:// <0> as soon as it finds out in the InputString <1> println each string and see why some strings dont have http:// <1> perhaps it's also case sensitive? <0> Case doesn't matter here. <0> Everything is in lowerCase <1> ok <2> write a test case in JUnit <2> do it for only those 3 or 4 lines <0> Ohh well, that'd take sometime. <2> not really <1> niTew[]lF: well println each string before indexOf <1> and also println if it is -1 <2> if you're using an IDE it's quite fast <1> or just println when it is -1 <1> and see when it fails <0> Alright <0> I don't get it man.... Its a freaking PAIN. <1> hehe <3> This is a bit of a stupid question, but the books aren't really helpful. I've written an abstract cl*** say, FileOb, in FileOb.java, and extended it to TXTFileOb in TXTFileOb.java . But the latter will not compile cleanly - I get the "cannot find symbol error". The book I am using describes all inheritence matters in the context of a single file. What am I doing wrong? <1> are they in same package? <3> wolfey: They are in the same folder - I haven't packaged them yet. <1> are you trying to access private variables of supercl***? <3> wolfey: No. <3> I declared no attributes as private <3> I suppose the default is public... <3> I am certain it must be something so simple..... <3> public cl*** FileOb {...........................} <3> in FileOb.java <1> ksk_BRB: you can paste both files to pastebin.com <1> :P <1> and let us see <3> and public cl*** TXTFileOB extends FileOB {...........................} <3> is that right? <1> yes <1> well doesnt it say in which line? <3> sigh <1> it doesnt find symbol <3> I get a number of errors <1> always start with first <3> one is that it cannot even find FileOB <4> default is package and your package statement should be the first line of code in your programs <1> well if it cant find FileOB, it's logical that all else is error <3> sabre: I did not use packages. Wont TXTFileOb find FileOb in the same folder it is in? <4> ksk_BRB: dunno..always package stuff here <1> ksk_BRB: when you give up, paste both files to pastebin.com and show us <1> :)) <3> Sure <3> wolfey, sabre: I put it up on pastebin, under kkaisare <1> give us url <1> it generated one <3> http://pastebin.com/659737
<3> You'll notice I included my compilation attempts at the end. <4> Note: FileOb.java uses unchecked or unsafe operations <-- wtf is that? <3> sabre: That is a warning generated by jdk1.5 <3> sabre: Compiles cleanly under jdk1.4 <4> ok did you try to do whta it said? <4> ahhh <4> Note: Recompile with -Xlint:unchecked for details. <-- prolly need to do that <3> sabre: Did before. No change. I am so sure it is this small timy thing I've overlooked. <2> I'll try here under 1.5 <4> ksk_BRB: the subcl*** will not compile unless the super cl*** does <1> ksk_BRB: names are case sensitive. and if you dont provide () constructor in super cl***, you must do same constructor in derived cl***: http://pastebin.com/659752 <4> that makes sense <1> ksk_BRB: feel free to declare public anythign u want <1> i commented some stuff to compile in single file <5> why is this warning: D:\Development\Java\Studio Enterprise 8\Komodo\src\Utils\FormDefinition\Fields\Transfer.java:49: warning: [unchecked] unchecked call to add(E) as a member of the raw type java.util.ArrayList <3> sabrewolfey: Which line nos, did you change? <1> ksk_BRB: all that contained FileOB <6> Sancy : google the error msg to get some background <1> commented out second include's and all package <5> ok <1> changed cl***es to protected <1> but especially 157 <1> and 147 <1> that was wrong <4> errrr prolly wanna just go public <1> well i removed public so i had single .java <1> doesnt change much <2> changed the constructor and BufferedFileReader can't be found here. Rest works <5> got it how to solve it :D <1> sticazzi: yup <4> definitely don't use default(package)...it is the most restrictive in many ways <3> wolfey: Looking into it....... <6> g8t , Sancy <3> wolfey: Why do we need that constructor? <1> ksk_BRB: because you dont provide () constructor in supercl*** <1> only (String) one <3> @@ <1> ksk_BRB: dont take it too hard <1> :)) <3> Wait a minute, does that mean I should comment out the constructor in FileOb? <1> no. it means it makes no sense to construct FileOb instance without file <2> TXTFileOb(String filepath) {super(filepath);} <2> if you use that as a constructor it makes sense <1> sticazzi: i did same ;) <2> technically speaking I didn't do it. I let Eclipse fix it for me :D <1> i used gnome editor <1> didnt wanna bother with importing to NetBeans <2> I used to use NetBeans, don't know why I switched. Netbeans has a good swing designer, though <1> well eclipse is a bit more pretty <1> :)) <7> sticazzi, you can get matize for eclipse <7> its the netbeans gui designer <2> ahh, nice :-) <3> wolfey: Hmm, I am still getting the same errors... <1> mmmm <1> and one thing, if you want to use package, you must run it from outside package dir, with java package.Cl*** <2> Rob_uknow, do you have a link to it? can't find it with http://www.google.com/search?q=matize <7> http://www.myeclipseide.com/ContentExpress-display-ceid-77.html <3> wolfey: Under what circumstances would TXTFileOb not be able to find FileOb? <7> ofcourse eclipse offers the visual editor already <1> 1. if you use different cases for chars... java is case sensitive. 2. if they are not in same directory AND package <2> visual editor isn't that good <3> Can you see if it works for two files? separately, I mean? <2> ksk_BRB, I did it in two files to start with <1> ksk_BRB: http://86.61.12.211/fileob/ compiles <1> dunno if it works <1> oh and make second cl*** public:P <8> I am trying to read a file convert it to a double and ***ign it to an array here is what i got so far http://pastebin.com/659851 <8> any help would be appreciated <7> I can kick you
Return to
#java or Go to some related
logs:
Nuclaer warfare #linuxhelp #c++ #MissKitten #chatzone #php #php kiwies girls . com #london share internet from windows to Linux
|
|