- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 34494 Articles for Programming
![Malhar Lathkar](https://www.tutorialspoint.com/assets/profiles/7345/profile/60_93814-1511173378.jpg)
1K+ Views
For this purpose, we create an object of HashMap class which is defined in java.util packageMap map = new HashMap();This hashmap object associates each digit with its corresponding word representationmap.put("0", "zero");Initialize an empty string object.String newstr="";Next, run a for loop over the length of given string and extract each character by substring() method of String class.Check if the character exists as a key in map object by containsKey() method. If it does, using it as key, obtain its value component in map and appenf\d to the new string. If not append the character itself to the new string. The complete code ... Read More
![Sreemaha](https://www.tutorialspoint.com/assets/profiles/13570/profile/60_64977-1512709068.jpg)
4K+ Views
While choosing an identifier to declare a variable in Java you need to keep the following points in mind. The name of the variable should begin with either alphabet or, an underscore (_) or, a dollar ($) sign. The identifiers used for variables must not be keywords. No spaces or special characters are allowed in the variable names of Java. Variable names may contain 0 to 9 numbers (if not at the beginning). Variable names are case sensitive i.e. MY_NUM is different from my_num. If you use two words in a identifier then the you should follow camel case ... Read More
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
257 Views
There will be times when we need to remove files programmatically in Python. Removing files, in this context, is the act of deleting or erasing files from a computer's file system using Python programming language. You must know that when you remove a file, it is permanently deleted from the storage location; this frees up disk space and makes the file inaccessible. Python has a number of modules and functions, such as os.remove() or os.unlink(), that permit you to interact with the operating system and remove files using code. This functionality is particularly useful when we want to automate tasks, ... Read More
![varma](https://www.tutorialspoint.com/assets/profiles/13568/profile/60_26300-1512638592.jpg)
3K+ Views
While writing a method name we should follow the camel case i.e. first letter of the first word should be small and the first letters of the remaining (later) words should be capital. Example public class Test { public void sampleMethod() { System.out.println("This is sample method"); } public void demoMethod() { System.out.println("This is demo method"); } public static void main(String args[]) { Test obj = new Test(); obj.sample(); obj.demo(); } } Output This is sample method This is demo method
![usharani](https://www.tutorialspoint.com/assets/profiles/13564/profile/60_32161-1512638316.jpg)
4K+ Views
While writing class names you need to keep the following points in mind. You shouldn’t use predefined or existing class names as the name of the current class. You shouldn’t use any Java keywords as class name (with the same case). The First letter of the class name should be capital and remaining letters should be small (mixed case). class Sample Likewise, first letter of each word in the name should be capital an remaining letters should be small. class Test Keeping interface names simple and descriptive is suggestable. Better not ... Read More
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
815 Views
You can use the tempfile module to create a unique temporary directory in the most secure manner possible. There are no race conditions in the directory’s creation. The directory is readable, writable and searchable only by the creating user ID. Note that the user of mkdtemp() is responsible for deleting the temporary directory when done with it. To create a new temporary directory, use it as follows −import tempfile _, temp_dir_path = tempfile.mkdtemp() # Do what you want with this directory # And remove the directory when doneNote that you need to manually delete this directory after you're done with ... Read More
![Rajendra Dharmkar](https://www.tutorialspoint.com/assets/profiles/9963/profile/60_124173-1512724240.jpg)
628 Views
You can use the tempfile module to create a unique temporary file in the most secure manner possible. There are no race conditions in the file’s creation. The file is readable and writable only by the creating user ID. Note that the user of mkstemp() is responsible for deleting the temporary file when done with it. To create a new temporary file, use it as follows −import tempfile _, temp_file_path = tempfile.mkstemp() print("File path: " + temp_file_path)Note that you need to manually delete this file after you're done with it.
![Prabhas](https://www.tutorialspoint.com/assets/profiles/13554/profile/60_90506-1512543588.jpg)
564 Views
KeywordsKeywords in Java convey a special meaning to the compiler therefore, these cannot be used as identifiers. Java provides a set of 50 keywords.abstractcontinuefornewswitchassertdefaultgotopackagesynchronizedbooleandoifprivatethisbreakdoubleimplementsprotectedthrowbyteelseimportpublicthrowscaseenuminstanceofreturntransientcatchextendsintshorttrycharfinallongstrictfpvolatileconstfloatnativesuperwhileReserved wordsAmong the list of key words list mentioned above the key words goto and const are currently not in use. They are reserved words (for the future use).
![seetha](https://www.tutorialspoint.com/assets/profiles/13549/profile/60_42938-1512640859.jpg)
680 Views
A valid identifier in java – Must begin with a letter (A to Z or a to z), currency character ($) or an underscore (_). Can have any combination of characters after the first character. Cannot be a keyword. Example Following example shows various possible identifiers used to declare a variable in Java. Live Demo public class VariableTest { public static void main(String args[]) { // Declaring a variable named num int num = 1; ... Read More