So as you may recall I have posted several threads in this forum trying to understand OOP and I wanted to share with everyone my "Eureka Moment"!! I have been reading Head First Java for the past week or so and I'm getting towards the end and I see an example for a Jukebox and it's songs and the light bulb finally came on!
I immediately saw how an assignment I was given today should be done! The constructors, the test class, the getters and setters, everything just came together!
So I want to thank all of you that helped in creating the foundation that the Head First book was able to build on in such a way that I GET IT!!!
Here's my first new class!! It doesn't really DO very much yet, but I'll get to that, for now I'm just FRICKIN' THRILLED THAT I GET IT!! Of course if you see something that I'm doing wrong, please feel free to burst my bubble!!
And suggestions on how to take in a location=
[tt]currentFolder = "\\srvname\images\Citations\0000044"[/tt]
and find that location and get the number of files in that folder?
Leslie
Have you met Hardy Heron?
I immediately saw how an assignment I was given today should be done! The constructors, the test class, the getters and setters, everything just came together!
So I want to thank all of you that helped in creating the foundation that the Head First book was able to build on in such a way that I GET IT!!!
Here's my first new class!! It doesn't really DO very much yet, but I'll get to that, for now I'm just FRICKIN' THRILLED THAT I GET IT!! Of course if you see something that I'm doing wrong, please feel free to burst my bubble!!
Code:
public class ScannedImageFolder {
public String currentFolder;
private int imageCount;
private boolean timeToChange = false;
ScannedImageFolder(String c){
currentFolder = c;
}
public String getCurrentFolder (){
return currentFolder;
}
public void setCurrentFolder(String c){
currentFolder = c;
}
private void setImageCount() {
//code to get # of files
//imageCount = # of files;
imageCount = 11500;
}
private void settimeToChange () {
if (imageCount > 12000){
timeToChange = true;
}
}
}
And suggestions on how to take in a location=
[tt]currentFolder = "\\srvname\images\Citations\0000044"[/tt]
and find that location and get the number of files in that folder?
Leslie
Have you met Hardy Heron?