any one good with java

Watch
chowe83
Badges: 6
Rep:
?
#1
Report Thread starter 1 month ago
#1
anyone good at java programming
0
reply
winterscoming
Badges: 19
Rep:
?
#2
Report 1 month ago
#2
Have you got a particular question about Java/programming?


By the way, anything related to programming might fit better on the web and coding forum here -- https://www.thestudentroom.co.uk/forumdisplay.php?f=119
0
reply
chowe83
Badges: 6
Rep:
?
#3
Report Thread starter 1 month ago
#3
yep I need some help and advice I have to make a scripted to read some files with last accessed and time and date of creation that will output the name size made made and modified and but it in a text file
0
reply
winterscoming
Badges: 19
Rep:
?
#4
Report 1 month ago
#4
(Original post by chowe83)
yep I need some help and advice I have to make a scripted to read some files with last accessed and time and date of creation that will output the name size made made and modified and but it in a text file
There are classes which you can use for this in a Java package called java.nio.file.

There's a class called BasicFileAttributes which can help https://docs.oracle.com/javase/8/doc...ttributes.html
There's a good page on that here: https://docs.oracle.com/javase/tutor...ttr.html#basic

You might find it useful to be able to use the java.io.FIle class as well for basic stuff like listing all files in a directory:
https://stackoverflow.com/questions/...lder-from-java


If you're not entirely sure where to start, begin with a new blank program which you can use to paste some of the example code into that program so that you can see how those classes work and get used to using them (think of it like prototyping, it's a really useful and important first step)
- You will definitely want to be able to see what they are capable of. It'll be really useful to test it with some 'hard coded' file path or directory before you build it into your main program, just so that you can get a feel for java.nio.file BasicFileAttributes and how it works.


Otherwise, how do you feel about the basics of Java? e.g. Array/ArrayList, String, for/while loops, System.out.print, if/else, etc? You'll need to be comfortable with all those things too. (it would also be really useful to have a good IDE and to be able to use its debugger if you aren't already -- that can make your life much easier)

Also, before you get too caught up with writing code make sure you think carefully about what the program is actually doing from a user point-of-view. i.e. things like:
  • How would the program know which file(s) to get that information for? e.g. is it from a user selecting from a list? or entering the name? Or choosing from the GUI? or providing a folder/directory? -- this is really a separate problem to be solved since it's really just about user input
  • What does the structure/format of the file need to look like? (For example, would you want it in .CSV format so that it can be opened in Excel? ) -- again, the output file is also an entirely separate problem which you can look at separately.

It's really useful to think of an example scenario with some example that you can test this with piece-by-piece, so that you know whether the code you're writing is doing what you expect.
Last edited by winterscoming; 1 month ago
2
reply
chowe83
Badges: 6
Rep:
?
#5
Report Thread starter 1 month ago
#5
what would you recommend for a good ide for a beginner
0
reply
winterscoming
Badges: 19
Rep:
?
#6
Report 1 month ago
#6
(Original post by chowe83)
what would you recommend for a good ide for a beginner
I would use IntelliJ IDEA (the Community Edition is free) since it does a lot of things which assist you in writing code like autocomplete, highlighting errors, pop-up help/tooltips, etc.

You have to go through a bunch of steps to get it set up the first time, but after that it should be simple enough to use, and you'll get used to it quite quickly

  1. Start with this to install Community Edition - https://www.jetbrains.com/help/idea/...ion-guide.html
  2. Then: https://www.jetbrains.com/help/idea/...irst-time.html and/or https://www.youtube.com/watch?v=c0efB_CKOYo
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Do you think non-essential uni exams should be cancelled?

Yes, they should be cancelled altogether (21)
45.65%
No, they should still go ahead (11)
23.91%
They should be cancelled for everyone but final year (14)
30.43%

Watched Threads

View All