Java Quickies (16 Part Series)
1 Java Quickies. Exceptions
2 Java Quickies. Paths
… 12 more parts…
3 Java Quickies. Arrays, Lists and ArrayLists
4 Java Quickies. Generics
5 Java Quickies. The Call Stack
6 Java Quickies. Singleton Pattern
7 Java Quickie. Threads vs Processes
8 Java Quickie. Compilers
9 Java Quickie. Nested classes
10 Java Quickie. Stack
11 Java Quickie. Annotations
12 Java Quickie. The .class syntax
13 Java Quickie. Abstract classes vs interfaces
14 Java Quickie. Decorator Pattern
15 Java Quickies. Class loading and linking in the JVM
16 Java Quickies. Streams and Lambda expressions
Introduction
- This series is going to be dedicated to the basic understanding of Java. When ever I find myself asking, “How does this work ?”. I will create a blog post and put it here. This series will not be in order so feel free to read what ever post you find most relevant.
What is a path?
-
In Java a path is a class and as the name implies, the path is a programmatic representation of a path in your file system.
-
A Path instance reflects the underlying platform. In Windows the path object uses the Windows syntax(C:\home\joe\foo). Your path may look different depending on your underlying operating system.
-
A Path is not system independent, you can not compare a path from two different operating systems and expect them to reach the same directory.
-
A Path object represents a path that is hierarchical and composed of a sequence of directory and file name elements. These elements are separated by a special separator called a delimiter. A Path object also contains a root component, that identifies the file system’s hierarchy. The name of the element that we are accessing is the one farthest from the root directory(cat)
C:\foo\pie\cat
Enter fullscreen mode Exit fullscreen mode
- The above code is an example of a path in the Windows environment. The “C:” is the root directory in Windows and it represents our C-drive, which is the main hard drive. The backslashes are examples of the delimitators and are used as a form of separation. cat is the element that we are accessing.
Conclusion
- Thank you for taking the time out of you day to read this blog post of mine. If you have any questions or concerns please comment below or reach out to me on Twitter.
- Also make sure to checkout my YouTube channel for more programming tutorials.
Java Quickies (16 Part Series)
1 Java Quickies. Exceptions
2 Java Quickies. Paths
… 12 more parts…
3 Java Quickies. Arrays, Lists and ArrayLists
4 Java Quickies. Generics
5 Java Quickies. The Call Stack
6 Java Quickies. Singleton Pattern
7 Java Quickie. Threads vs Processes
8 Java Quickie. Compilers
9 Java Quickie. Nested classes
10 Java Quickie. Stack
11 Java Quickie. Annotations
12 Java Quickie. The .class syntax
13 Java Quickie. Abstract classes vs interfaces
14 Java Quickie. Decorator Pattern
15 Java Quickies. Class loading and linking in the JVM
16 Java Quickies. Streams and Lambda expressions
原文链接:Java Quickies. Paths
暂无评论内容