{"id":25529211,"date":"2022-06-19T23:59:05","date_gmt":"2022-06-19T18:29:05","guid":{"rendered":"https:\/\/entri.app\/blog\/?p=25529211"},"modified":"2022-11-19T17:35:21","modified_gmt":"2022-11-19T12:05:21","slug":"what-is-system-class-in-java-and-how-to-use-it","status":"publish","type":"post","link":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/","title":{"rendered":"What is System Class in Java and How to Use it?"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_79_2 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69e7c3be56f70\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69e7c3be56f70\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#1_Open_a_File\" >1) Open a File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#2_Get_User_Input\" >2) Get User Input<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#3_Print_on_Standard_Output\" >3) Print on Standard Output<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#4_Set_Date_and_Time\" >4) Set Date and Time<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#5_Read_Keyboard_Input\" >5) Read Keyboard Input<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#6_Update_Files_Folders_or_Directories\" >6) Update Files, Folders, or Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#7_Write_Data_to_a_File\" >7) Write Data to a File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#8_Quit_Application_or_Exit_a_Method\" >8) Quit Application or Exit a Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#9_Create_New_Files_Folders_or_Directories\" >9) Create New Files, Folders, or Directories<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#10_Load_External_Libraries\" >10) Load External Libraries<\/a><\/li><\/ul><\/nav><\/div>\n<p><span data-slate-fragment=\"JTVCJTdCJTIydHlwZSUyMiUzQSUyMnBhcmFncmFwaCUyMiUyQyUyMmNoaWxkcmVuJTIyJTNBJTVCJTdCJTIydGV4dCUyMiUzQSUyMlN5c3RlbSUyMGNsYXNzJTIwaW4lMjBKYXZhJTIwaXMlMjBvbmUlMjBvZiUyMHRoZSUyMG1vc3QlMjB1c2VkJTIwY2xhc3NlcyUyMGluJTIwSmF2YSUyMEFQSSUyMHdoaWNoJTIwY29udGFpbnMlMjBzdGF0aWMlMjBtZXRob2QlMjBhbmQlMjBzdGF0aWMlMjB2YXJpYWJsZSUyMHdoaWNoJTIwbWVhbnMlMjBpdCUyMHdpbGwlMjBiZSUyMHNhbWUlMjBmb3IlMjBhbGwlMjB0aGUlMjBpbnN0YW5jZXMlMjBvZiUyMGNsYXNzJTIwaXQlMjBiZWxvbmdzJTIwdG8uJTIwRm9yJTIwZXhhbXBsZSUyQyUyMGlmJTIweW91JTIwd2FudCUyMHRvJTIwZ2V0JTIwaW5mb3JtYXRpb24lMjBhYm91dCUyMHlvdXIlMjBzeXN0ZW0lMjB0aGVuJTIweW91JTIwY2FuJTIwdXNlJTIwU3lzdGVtJTIwY2xhc3MlMjB3aGljaCUyMHdpbGwlMjByZXR1cm4lMjBpbmZvcm1hdGlvbiUyMGFib3V0JTIweW91ciUyMHN5c3RlbSUyMG9uJTIwd2hpY2glMjBwcm9ncmFtKGkuZS4lMkMlMjBKYXZhJTIwcHJvZ3JhbSklMjBpcyUyMHJ1bm5pbmcuJTIyJTdEJTVEJTdEJTVE\">System class in Java is one of the most used classes in Java API which contains static method and static variable which means it will be the same for all the instances of class it belongs to. For example, if you want to get information about your system in java then you can use System class which will return information about your system on which program(i.e., Java program) is running. <\/span>System class in Java refers to the System class of java.lang package, which is a package that includes many <a href=\"https:\/\/entri.app\/blog\/top-10-java-debugging-techniques-and-tricks\/\" target=\"_blank\" rel=\"noopener\">useful methods<\/a> and classes, such as Math, String, Arrays, I\/O classes, and wrapper classes to primitive data types etc. In this article, we will study what system class in Java (system class of java.lang package) means and how it can be used? In addition, we will also have a look at 10 ways to use system in java language? So let\u2019s get started! <span data-slate-fragment=\"JTVCJTdCJTIydHlwZSUyMiUzQSUyMnBhcmFncmFwaCUyMiUyQyUyMmNoaWxkcmVuJTIyJTNBJTVCJTdCJTIydGV4dCUyMiUzQSUyMlRoZSUyMFN5c3RlbSUyMGNsYXNzJTIwY29udGFpbnMlMjBhJTIwbnVtYmVyJTIwb2YlMjBzdGF0aWMlMjB1dGlsaXR5JTIwbWV0aG9kcyUyMHRoYXQlMjBjYW4lMjBoZWxwJTIweW91JTIwd3JpdGUlMjBtb3JlJTIwcmVhZGFibGUlMkMlMjB1bmRlcnN0YW5kYWJsZSUyMGNvZGUuJTIwVGhlc2UlMjBtZXRob2RzJTIwYWxsb3clMjB5b3UlMjB0byUyMGRvJTIwdGhpbmdzJTIwbGlrZSUyMGRldGVybWluZSUyMHRoZSUyMHR5cGUlMjBvZiUyMHN5c3RlbSUyMHlvdSVFMiU4MCU5OXJlJTIwcnVubmluZyUyMG9uJTJDJTIwYWNjZXNzJTIwdXNlciUyMGFjY291bnQlMjBpbmZvcm1hdGlvbiUyQyUyMGFuZCUyMGZpbmQlMjBvdXQlMjB5b3VyJTIwY3VycmVudCUyMHRpbWUlMjB6b25lLiUyMFRoZXJlJTIwYXJlJTIwYWxzbyUyMGhlbHBmdWwlMjBzdGF0aWMlMjB1dGlsaXR5JTIwY2xhc3NlcyUyMHRoYXQlMjBleHRlbmQlMjBTeXN0ZW0lM0IlMjB0aGV5JTIwcHJvdmlkZSUyMGZlYXR1cmVzJTIwbGlrZSUyMGZvcm1hdHRpbmclMjBudW1iZXJzJTIwYXMlMjBjdXJyZW5jeSUyMG9yJTIwcGxhaW4lMjB0ZXh0JTJDJTIwd29ya2luZyUyMHdpdGglMjBhcnJheXMlMjBvZiUyMG9iamVjdHMlMkMlMjBhbmQlMjBtYW5pcHVsYXRpbmclMjB0ZXh0JTIwdXNpbmclMjByZWd1bGFyJTIwZXhwcmVzc2lvbnMuJTIwVGhlJTIwcmVzdCUyMG9mJTIwdGhpcyUyMGFydGljbGUlMjB3aWxsJTIwc2hvdyUyMHlvdSUyMDEwJTIwd2F5cyUyMHRvJTIwdXNlJTIwdGhlJTIwU3lzdGVtJTIwY2xhc3MlMjBpbiUyMEphdmElMjBhbmQlMjBpdHMlMjBleHRlbnNpb24lMjBsaWJyYXJpZXMlMjB0byUyMG1ha2UlMjB5b3VyJTIwY29kZSUyMG1vcmUlMjByZWFkYWJsZSUyMGFuZCUyMG1haW50YWluYWJsZS4lMjIlN0QlNUQlN0QlNUQ=\">The System class contains a number of static utility methods that can help you write more readable, understandable code. These methods allow you to do things like determine the type of system in java you\u2019re running on, access user account information, and find out your current time zone. There are also helpful static utility classes that extend system in java; they provide features like formatting numbers as currency or plain text, working with arrays of objects, and manipulating text using regular expressions. The rest of this article will show you 10 ways to use the system in java and its extension libraries to make your code more readable and maintainable.<\/span><\/p>\n<p><a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-25520997 size-full\" src=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\" alt=\"\" width=\"970\" height=\"250\" srcset=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png 970w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-300x77.png 300w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-768x198.png 768w, https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle-750x193.png 750w\" sizes=\"auto, (max-width: 970px) 100vw, 970px\" \/><\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"1_Open_a_File\"><\/span><strong>1) Open a File<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>System.out.println(); and System.in.read() are both examples of functions provided by java\u2019s standard class library, that\u2019s right, java comes with a variety of different classes out of box to help developers quickly and easily complete common tasks while building their app or software product, system being one of them so it can be used to open any type of file on your computer such as a .txt or .doc file or even .mp3 file among many others&#8230;it\u2019s important for developers new and old alike to take advantage of what is already available within java because it will most certainly make your job easier and can save you hours of time (which translates into dollars) in development costs down-the-road! So don&#8217;t forget to look at what&#8217;s available to you in java&#8217;s library of classes when writing code for your next project. Getting File Name &amp; Extension How do we get just only file name without extension? We have two options. One is by using method getName(). And another option is by using method getAbsolutePath(). Both methods returns String object which contains only filename not extension.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Get_User_Input\"><\/span><strong>2) Get User Input<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of the key methods of getting information into your Java application is by asking users for it. This can be done with a simple JOptionPane object that allows your user to enter some input. The System class provides several methods that will allow you to get text or other values from your user and incorporate them into your program. The next few methods use these classes and get data from users with either an OK or Cancel button for confirmation. When deciding what types of<a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\"> input fields<\/a> are best for your app, you need to think about what kinds of information you want from users, how much input should be required, and how often they&#8217;ll need to give it. If there&#8217;s one piece of advice we&#8217;d give here, it&#8217;s to make sure you&#8217;re only asking for information that&#8217;s relevant and necessary. Users don&#8217;t like having to fill out forms if they don&#8217;t have to. Don&#8217;t make them do more than they have to! Here are some examples of different ways to get user input using System class: The java.lang.System class contains many static utility methods for performing system-related tasks such as querying environment variables, controlling execution flow, manipulating dates and times, etc.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Enroll in our latest java programming course in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Print_on_Standard_Output\"><\/span><strong>3) Print on Standard Output<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>System.out.println() is a method in java System class which can be used to print messages on screen. This method accepts a single parameter that is string literal specifying a message to be printed on screen. For example, System.out.println(Hello Java); The text Hello Java will appear on screen and no new line will be inserted after printing, it just prints a single line of text and that\u2019s it, output stops there itself. This is one of my favorite methods as it doesn\u2019t require any object creation or instantiation for performing its task. Just one line of code and you are done with your work. Very easy &amp; simple to use! No doubt! Java provides many ways to create objects but System class provides only one way i.e <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">creating an<\/a> object using String literals &amp; then using out keyword for printing them on screen or anywhere else for that matter! So, I love using these two features together as they provide quick &amp; easy way to perform some basic tasks without any object creation overhead! And best part is they are easy to understand &amp; implement too! If you have used C\/C++ language before, you must be aware of printf() function which can be used to print messages on screen. This method accepts a variable number of parameters (1-n) and prints each parameter separated by space character after performing necessary formatting operations like inserting commas between numbers etc. Similarly, java also has its own version of printf() function called System.out::println(). The difference between both methods is that java\u2019s println() doesn\u2019t accept variable number of parameters unlike printf(). It accepts a single string literal as parameter and performs its task.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get free placement assistance with the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Set_Date_and_Time\"><\/span><strong>4) Set Date and Time<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The java.util.Date class provides a wide range of functionality for managing dates and times, including parsing from strings and comparing dates. Your app can perform many operations using built-in methods, but Date is just one class that you&#8217;ll use when working with time and date information in Java. For more powerful capabilities, such as simulating time travel or keeping track of time zones, use classes from java.time (javax.time), which was introduced with JDK 8; these include <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">ChronoLocalDate<\/a> and OffsetTimeZone classes (which were added later) as well as LocalTime , ZonedDateTime , Instant , Duration , Period , etc., which were already present in earlier versions of Java. Using java.time allows your code to run on any platform where JVM runs, while still supporting all previous versions of Java. And if you&#8217;re writing an Android app, it&#8217;s worth noting that Google Play Services includes classes for managing alarms and reminders on Android devices; see its TimePickerDialog and CalendarFragment . (Note: we will not cover those here.) The current system clock time according to device\u2019s local clock. This value may be different than what is returned by System#currentTimeMillis() because it does not take into account adjustments made by user settings or DST rules changes.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Get the latest updates on java programming in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"5_Read_Keyboard_Input\"><\/span><strong>5) Read Keyboard Input<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>By asking users for input from a keyboard, you can interact with them much more efficiently than if you made them enter text via other means. You\u2019ll likely want some way of validating input, but using keyboard input is an excellent solution when it comes to speed and efficiency. To read inputs from a user\u2019s keyboard, use System.in.read(): System.in.read() takes no arguments and returns an array of characters that are entered on a keyboard or similar device (such as a touchscreen). Each character is held within its own element of the returned array. The code below demonstrates how to use System.in.read() to get a single key press from a user: import java.util.*; public class ReadKeyboardInput { public static void main(String[] args) { String command = ; int response = 0; Scanner reader = new Scanner(System.in); while (true) { command += reader.next(); response = Integer.parseInt(command); } } } Run <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">your program<\/a> and try entering various commands into your console window\u2014you should see responses printed out beneath each command prompt! As you might have guessed, there are many ways to format your commands so that they return specific values. Try adding 1 + 2 * 3 to your program and notice what happens when you run it again. What about 1 + 2 * 3 \/ 4 ? A few notes about system input: When dealing with system input, there are several things worth keeping in mind. First off, note that System.in is not really a file at all; rather, it&#8217;s simply an object representing standard input\u2014the place where programs like CMD or PowerShell accept data from users before interpreting it as commands and executing it them accordingly.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"6_Update_Files_Folders_or_Directories\"><\/span><strong>6) Update Files, Folders, or Directories<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of System.out\u2019s biggest use cases is sending information or messages that are displayed in your terminal. When using it, you pass a string as a parameter and send it through out.println( ); Once you press enter, your message will be displayed to you. For example, if you wanted to change a certain directory\u2019s name, system.out would be useful for sending a notification about what was changed and where. On top of that, you can also have it output files so that you know exactly which file has been <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">updated instead<\/a> of having to guess by looking at an icon with writing on it (like most people do). There are plenty more things system class can do, but let\u2019s take a look at 10 ways we use it! 1. Changing Directories \u2013 Instead of opening up your computer and going into My Computer to find a specific folder, why not just write out cd followed by a specific folder? If you need to go back one step, just type in cd&#8230; It\u2019s really easy and really helpful when used correctly!2. Creating New Folders \u2013 Let\u2019s say I want to create a new folder named projects. To do that I could simply write mkdir projects followed by pressing enter. Boom! A new folder has been created without me even touching my mouse or clicking anything!<\/p>\n<h2><span class=\"ez-toc-section\" id=\"7_Write_Data_to_a_File\"><\/span><strong>7) Write Data to a File<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>One of many ways to store data is by writing it to a file. If you plan on using your application, again and again, storing data locally (on a disk) may be more convenient than saving it online or reading from a database. Storing data as text means you don&#8217;t have any <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">special requirements<\/a> for your storage media; text files can live on almost any device with storage. There are several different types of files that you could use, including text, CSV and XML files. The choice is yours! Regardless of which type of file you choose, all you need to do is create an object representing your file, open it for writing and then write out your data. To close up shop when you&#8217;re done, just call close() on your FileWriter object. For example: System . out . println ( Writing some stuff&#8230; ) ; FileWriter fw = new FileWriter ( outfile ) ; fw . write ( Hello World! ) ; fw . close () ; } } public static void main ( String [] args ) { Example ex = new Example () ; ex . doStuff () ; } } This will write Hello World! to a file called outfile in whatever directory you run it from.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">To know more about java programming in Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"8_Quit_Application_or_Exit_a_Method\"><\/span><strong>8) Quit Application or Exit a Method<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>When you finish an application or a method, you will often want to quit or exit that specific application. To do so, use System.exit(0) . This indicates that your application should end without any exceptions or errors. You can use System.exit(-1) , which indicates your application should end with an error exception if it\u2019s been properly compiled (i.e., with debug information). The difference between these two options is mostly of academic interest; generally speaking, you will always want to use 0 when <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">exiting applications<\/a> because it allows for graceful termination of your applications and cleanly releasing system resources for other processes to utilize. If you need to terminate your application abnormally, then -1 is a better option. In either case, however, make sure that all threads have terminated before attempting to exit your application! If they haven\u2019t yet terminated by the time you call System.exit() , then they won\u2019t be able to terminate normally. Instead, they will wait indefinitely until all threads have exited\u2014at which point they are killed off by defaulting ThreadGroup policy! So make sure all threads have terminated before calling System.exit() !<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Enroll in our latest java programming course in the Entri app<\/a><\/p>\n<h2><span class=\"ez-toc-section\" id=\"9_Create_New_Files_Folders_or_Directories\"><\/span><strong>9) Create New Files, Folders, or Directories<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Many times, you&#8217;ll need to create new files or folders on your computer. For example, you might want to create a new folder inside of your Documents folder. To do so, first start by finding and opening that folder; on Windows PCs, press Control + E and type Documents into the file-location bar. Once you&#8217;ve opened that directory in Windows Explorer (or whatever else is synced with it), find a blank space on your desktop and hold Shift while right-clicking. In most cases, Shift + right-click will give you an option that says New &gt; Folder (and will automatically name it for you). This will open up a dialog box where you can fill out all of your details for that new folder. You can also use File Explorer to create new files\u2014just right-click in any empty area and choose New &gt; Text Document (or whatever other<a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\"> document type<\/a> you&#8217;d like) from the context menu. You&#8217;ll be able to fill out all of your details there as well. Alternatively, if you&#8217;re working directly in your preferred text editor, Ctrl + N will always bring up a prompt to create a new file. Be sure to set it up exactly how you want before saving it anywhere! When creating directories and files on macOS, just right-click anywhere within Finder and select New &gt; Folder or New &gt; File (depending on what kind of item you&#8217;d like to make). When prompted, fill out all necessary information about your newly created item(s). Keep in mind that both systems have more advanced options available than those listed here\u2014for example, using Command + N on macOS allows users to specify entire paths when creating items instead of just names. The exact way this work varies depending on what system software you&#8217;re using but should generally follow these basic rules.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"10_Load_External_Libraries\"><\/span><strong>10) Load External Libraries<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>System class is an important class that makes it easy for us to load other external libraries like Native system library, java native interface, java bindings, etc. Different ways of loading external libraries are given below. In most of these examples, we have used C program to demonstrate how libraries are loaded in different ways and how we can communicate with the foreign systems from java. 1. Using Runtime.getRuntime() Runtime.getRuntime() returns an instance of a class called java runtime which provides methods for accessing basic services provided by the hosting environment, such as input\/output and memory management. Inside a JVM there are two types of runtimes &#8211; &#8211; one is called <a href=\"https:\/\/entri.sng.link\/Bcofz\/uu8c\/w409\">application runtime<\/a> (aka App-JRE) and the other is called Native System (aka HOST-JRE). 2. Using Class.forName(String name) Method forName() loads a class using its string name, then calls its static initializer to initialize any static fields declared in that class. 3. Using ClassLoader.loadClass(String name) Method loadClass() loads a class using its string name, then calls its static initializer to initialize any static fields declared in that class 4. Using System.loadLibrary(String libname) This method loads an external native library into the running Java virtual machine (JVM), then looks up all symbols defined by functions exported from that library via dlsym(). If you are interested to learn new coding skills, the Entri app will help you to acquire them very easily. Entri app is following a structural study plan so that the students can learn very easily. If you don&#8217;t have a coding background, it won&#8217;t be any problem. You can download the Entri app from the google play store and enroll in your favorite course.<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/bit.ly\/3ELmCiA\">Enroll in our latest java programming course in the Entri app<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>System class in Java is one of the most used classes in Java API which contains static method and static variable which means it will be the same for all the instances of class it belongs to. For example, if you want to get information about your system in java then you can use System [&hellip;]<\/p>\n","protected":false},"author":93,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[802,1864,1882,1883,1881],"tags":[],"class_list":["post-25529211","post","type-post","status-publish","format-standard","hentry","category-articles","category-data-science-ml","category-java-programming","category-react-native","category-web-android-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>What is System Class in Java and How to Use it? - Entri Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is System Class in Java and How to Use it? - Entri Blog\" \/>\n<meta property=\"og:description\" content=\"System class in Java is one of the most used classes in Java API which contains static method and static variable which means it will be the same for all the instances of class it belongs to. For example, if you want to get information about your system in java then you can use System [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\" \/>\n<meta property=\"og:site_name\" content=\"Entri Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/entri.me\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-06-19T18:29:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-11-19T12:05:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\" \/>\n<meta name=\"author\" content=\"Akhil M G\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@entri_app\" \/>\n<meta name=\"twitter:site\" content=\"@entri_app\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Akhil M G\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\"},\"author\":{\"name\":\"Akhil M G\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6\"},\"headline\":\"What is System Class in Java and How to Use it?\",\"datePublished\":\"2022-06-19T18:29:05+00:00\",\"dateModified\":\"2022-11-19T12:05:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\"},\"wordCount\":2763,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\",\"articleSection\":[\"Articles\",\"Data Science and Machine Learning\",\"Java Programming\",\"React Native\",\"Web and Android Development\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\",\"url\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\",\"name\":\"What is System Class in Java and How to Use it? - Entri Blog\",\"isPartOf\":{\"@id\":\"https:\/\/entri.app\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\",\"datePublished\":\"2022-06-19T18:29:05+00:00\",\"dateModified\":\"2022-11-19T12:05:21+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png\",\"width\":970,\"height\":250},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/entri.app\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Entri Skilling\",\"item\":\"https:\/\/entri.app\/blog\/category\/entri-skilling\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Java Programming\",\"item\":\"https:\/\/entri.app\/blog\/category\/entri-skilling\/java-programming\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"What is System Class in Java and How to Use it?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/entri.app\/blog\/#website\",\"url\":\"https:\/\/entri.app\/blog\/\",\"name\":\"Entri Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/entri.app\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/entri.app\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/entri.app\/blog\/#organization\",\"name\":\"Entri App\",\"url\":\"https:\/\/entri.app\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"contentUrl\":\"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png\",\"width\":989,\"height\":446,\"caption\":\"Entri App\"},\"image\":{\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/entri.me\/\",\"https:\/\/x.com\/entri_app\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6\",\"name\":\"Akhil M G\",\"url\":\"https:\/\/entri.app\/blog\/author\/akhil\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is System Class in Java and How to Use it? - Entri Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/","og_locale":"en_US","og_type":"article","og_title":"What is System Class in Java and How to Use it? - Entri Blog","og_description":"System class in Java is one of the most used classes in Java API which contains static method and static variable which means it will be the same for all the instances of class it belongs to. For example, if you want to get information about your system in java then you can use System [&hellip;]","og_url":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/","og_site_name":"Entri Blog","article_publisher":"https:\/\/www.facebook.com\/entri.me\/","article_published_time":"2022-06-19T18:29:05+00:00","article_modified_time":"2022-11-19T12:05:21+00:00","og_image":[{"url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png","type":"","width":"","height":""}],"author":"Akhil M G","twitter_card":"summary_large_image","twitter_creator":"@entri_app","twitter_site":"@entri_app","twitter_misc":{"Written by":"Akhil M G","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#article","isPartOf":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/"},"author":{"name":"Akhil M G","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6"},"headline":"What is System Class in Java and How to Use it?","datePublished":"2022-06-19T18:29:05+00:00","dateModified":"2022-11-19T12:05:21+00:00","mainEntityOfPage":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/"},"wordCount":2763,"commentCount":0,"publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"image":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png","articleSection":["Articles","Data Science and Machine Learning","Java Programming","React Native","Web and Android Development"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/","url":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/","name":"What is System Class in Java and How to Use it? - Entri Blog","isPartOf":{"@id":"https:\/\/entri.app\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage"},"image":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage"},"thumbnailUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png","datePublished":"2022-06-19T18:29:05+00:00","dateModified":"2022-11-19T12:05:21+00:00","breadcrumb":{"@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#primaryimage","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2022\/04\/Python-and-Machine-Learning-Rectangle.png","width":970,"height":250},{"@type":"BreadcrumbList","@id":"https:\/\/entri.app\/blog\/what-is-system-class-in-java-and-how-to-use-it\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/entri.app\/blog\/"},{"@type":"ListItem","position":2,"name":"Entri Skilling","item":"https:\/\/entri.app\/blog\/category\/entri-skilling\/"},{"@type":"ListItem","position":3,"name":"Java Programming","item":"https:\/\/entri.app\/blog\/category\/entri-skilling\/java-programming\/"},{"@type":"ListItem","position":4,"name":"What is System Class in Java and How to Use it?"}]},{"@type":"WebSite","@id":"https:\/\/entri.app\/blog\/#website","url":"https:\/\/entri.app\/blog\/","name":"Entri Blog","description":"","publisher":{"@id":"https:\/\/entri.app\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/entri.app\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/entri.app\/blog\/#organization","name":"Entri App","url":"https:\/\/entri.app\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","contentUrl":"https:\/\/entri.app\/blog\/wp-content\/uploads\/2019\/10\/Entri-Logo-1.png","width":989,"height":446,"caption":"Entri App"},"image":{"@id":"https:\/\/entri.app\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/entri.me\/","https:\/\/x.com\/entri_app"]},{"@type":"Person","@id":"https:\/\/entri.app\/blog\/#\/schema\/person\/875646423b2cce93c1bd5bc16850fff6","name":"Akhil M G","url":"https:\/\/entri.app\/blog\/author\/akhil\/"}]}},"_links":{"self":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529211","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/users\/93"}],"replies":[{"embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/comments?post=25529211"}],"version-history":[{"count":5,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529211\/revisions"}],"predecessor-version":[{"id":25547445,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/posts\/25529211\/revisions\/25547445"}],"wp:attachment":[{"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/media?parent=25529211"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/categories?post=25529211"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/entri.app\/blog\/wp-json\/wp\/v2\/tags?post=25529211"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}