From the course: Coding Exercises: Scala
Unlock this course with a free trial
Join today to access over 25,300 courses taught by industry experts.
System properties - Scala Tutorial
From the course: Coding Exercises: Scala
System properties
(arcade game sounds) - [Instructor] In this challenge, we'll find the values of system properties. System properties control a lot of the behavior of the Java virtual machine. Properties come from environment variables and from settings passed to the JVM, that's the Java virtual machine, when it is started. The Scala Standard Library provides an API for accessing system properties, which is in Scala.sys.SystemProperties. Your challenge is to find and print all the system properties. We want to see the name and the value of each property. Now pull the video and come back when you finish the challenge. (arcade game sounds) - Here's my solution. I'm starting, as always, with the empty file we provided for you. What I'm going to do is first, get all of the properties which I need to create a new instance of system properties for. Get an iterator from it. And then go over all of the elements in that iterator.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
Palindrome detector2m 15s
-
(Locked)
Password checker4m 20s
-
(Locked)
Colored boxes2m 15s
-
(Locked)
System properties1m 17s
-
(Locked)
Resistor tolerance2m 36s
-
(Locked)
Snakes and camels1m 58s
-
(Locked)
Stuff the stats sheet5m 50s
-
(Locked)
A slice of Pi5m 13s
-
(Locked)
Cron and regular expressions4m 35s
-
(Locked)
Reservoir sampling4m 55s
-
(Locked)
Evaluate a decision tree3m 3s
-
(Locked)
Calculator2m 41s
-
(Locked)
Error handling2m 58s
-
(Locked)
Sierpinski Triangle2m 2s
-
(Locked)
Rocketship7m 16s
-