1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
nasty-shy [4]
2 years ago
8

Create a file using any word processing program or text editor. Write an application that displays the files, name, containing f

older, size, and time of last modification. Save the file as FileStatisits.java
Computers and Technology
1 answer:
MArishka [77]2 years ago
4 0

Answer:

below is a Shell I have ;

1.Import java.nio.file.*;

2.Import java.nio.file attribute.*;

3.Import java.10 Exception;

4.public class FileStatistics

5.{

6.public static void main(string []args)

7.{

8.path file=

9.

paths.get("C:\\Java\\chapter.13\\TestData.txt")

10.try

11.{

12.\\declare count and then display path, file, name and folder name.

13.

14.

15.

16.\\declare a BasicFileAttributes object, then add statements to display the file's size and creation time.

17.

18.}

19.

20.catch (10 Exception e)

21.{

22.\\add display 10 Exception

23.

24.}

25.}

You might be interested in
You have just installed a SOHO router in a customer’s home and the owner has called you saying his son is complaining that Inter
emmainna [20.7K]

Answer: A. Verify the wireless connection is using the fastest wireless standard the router supports.

D. Enable QoS for the gaming applications on the router and on the son's computer.

Explanation: Verifying the wireless connection is using the fastest wireless standard the router supports will improve line of connectivity and reduce network latency hence gaming consoles communicate faster.

QoS enables the prioritizing of the volume of internet traffic on the console for high quality gaming. QoS will also enable more internet bandwidth to be channeled to the gaming console.

6 0
3 years ago
What is the car on the right?
oksano4ka [1.4K]

looks like a rxc custom gt3 with a v6 *badass sport car*

3 0
3 years ago
Computer networks make setting appointments easier by _____.
Sunny_sXe [5.5K]

Probably providing a common calendar

5 0
3 years ago
Read 2 more answers
Type (dog, cat, budgie, lizard, horse, etc.) Create a class that keeps track of the attributes above for pet records at the anim
Alenkinab [10]

Answer:

If you did the exercise with two Dog objects, it was a bit boring, right? After all, we have nothing to separate the dogs from each other and no way of knowing, without looking at the source code, which dog produced which bark.

In the previous article, I mentioned that when you create objects, you call a special method called a constructor. The constructor looks like the class name written as a method. For example, for a Dog class, the constructor would be called Dog().

The special thing about constructors is that they are the path to any new object, so they are a great place to call code that initializes an object with default values. Further, the return value from a constructor method is always an object of the class itself, which is why we can assign the return value of the constructor to a variable of the type of class we create.

However, so far, we have not actually created a constructor at all, so how come we can still call that method?

In many languages, C# included, the language gives you a free and empty constructor without you having to do anything. It is implied that you want a constructor; otherwise there would be no way of using the class for anything, so the languages just assume that you have written one.

This invisible and free constructor is called the default constructor, and, in our example, it will look like this:

public Dog(){ }

Notice that this syntax is very similar to the Speak() method we created earlier, except that we do not explicitly return a value nor do we even declare the return type of the method. As I mentioned earlier, a constructor always returns an instance of the class to which it belongs.

In this case, that is the class Dog, and that is why when we write Dog myDog = new Dog(), we can assign the new object to a variable named myDog which is of type Dog.

So let’s add the default constructor to our Dog class. You can either copy the line above or, in Visual Studio, you can use a shortcut: type ctor and hit Tab twice. It should generate the default constructor for you.

The default constructor doesn’t actually give us anything new because it is now explicitly doing what was done implicitly before. However, it is a method, so we can now add content inside the brackets that will execute whenever we call this constructor. And because the constructor runs as the very first thing in an object’s construction, it is a perfect place to add initialization code.

For example, we could set the Name property of our objects to something by adding code such as this:

public Dog()

{

   this.Name = "Snoopy";

}

This example will set the Name property of any new objects to “Snoopy”.

Of course, that’s not very useful because not all dogs are called “Snoopy”, so instead, let us change the method signature of the constructor so that it accepts a parameter.

The parentheses of methods aren’t just there to look pretty; they serve to contain parameters that we can use to pass values to a method. This function applies to all methods, not just constructors, but let’s do it for a constructor first.

Change the default constructor signature to this:

public Dog(string dogName)

This addition allows us to send a string parameter into the constructor, and that when we do, we can refer to that parameter by the name dogName.

Then, add the following line to the method block:

this.Name = dogName;

This line sets this object’s property Name to the parameter we sent into the constructor.

Note that when you change the constructor’s signature, you get a case of the red squigglies in your Program.cs file.When we add our own explicit constructors, C# and .NET will not implicitly create a default constructor for us. In our Program.cs file, we are still creating the Dog objects using the default parameter-less constructor, which now no longer exists.

To fix this problem, we need to add a parameter to our constructor call in Program.cs. We can, for example, update our object construction line as such:

Dog myDog = new Dog(“Snoopy”);

Doing so will remove the red squigglies and allow you to run the code again. If you leave or set your breakpoint after the last code line, you can look at the Locals panel and verify that your object’s Name property has indeed been? Got it?

5 0
2 years ago
Given that it takes 0.08 ms to travel from one track to the next of a hard drive; that the arm is originally positioned at Track
daser333 [38]

Answer:

Time taken to travel from one track to the next = 0.08ms

Initial track= 15     0

4      (15-4)*(0.08)= 0.88

40     (40-4)*(0.08)= 2.88

35      (40-35)*(0.08)= 0.4

11       (35-11)*(0.08)= 1.92

14       (14-11)*(0.08)= 0.24

7         (14-7)*(0.08)= 0.56

----------------------------------------------

Total seek time=0.88+2.88+0.4+1.92+0.24+0.56=6.88ms

Explanation:

We caculate the seek time for each request, and then add them together to find the total seek time. The final track number for the current request becomes the current track of next request, and this process is repeated till the last request is processed.

4 0
3 years ago
Other questions:
  • Show the subnet address, subnet mask in slash notation, broadcast address, number of addresses, first valid host address, and th
    13·1 answer
  • Can y’all help me with these questions ?
    5·1 answer
  • How is the cia triad used to evaluate encryption methods?
    6·1 answer
  • Which small-group format would be most appropriate for the following situation? A large sporting event is coming to town. Key me
    14·2 answers
  • Positive use of the technology before the pandemic.
    8·1 answer
  • At year end, Clean123 Inc. has 45500 in cash, 55000 in accounts receivable, 54400 in service equipment, 550 in prepaid insurance
    12·1 answer
  • Using range(1,101), make two list, one containing all even numbers and other containing all odd numbers. How can I do this on Py
    15·1 answer
  • How is the architecture converted into software code? Elaborate the steps its passes through with help of examples / Diagram.
    15·1 answer
  • Write a statement that slices a substring out of the string quote and puts it into a variable named selection. If given the stri
    8·1 answer
  • Your network uses a network address of 137. 65. 0. 0 with a subnet mask of 255. 255. 0. 0. How many ip addresses are available t
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!