Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint
Cover Image
Cover Image
Drag to reposition
Contributed Answers

Generating password in Java

Answered on 14th Aug, 2018, 0 Views

Generate temporary password is now a requirement on almost every website now-a-days. In case a user forgets the password, system generates a random password adhering to password policy of the company. Following example generates a random password adhering to following conditions − It should contain at least one capital case letter. It should contain at least one lower-case letter. .....

Final Arrays in Java

Answered on 14th Aug, 2018, 0 Views

A final variable can be explicitly initialized only once. A reference variable declared final can never be reassigned to refer to a different object. However, the data within the object can be changed. So, the state of the object can be changed but not the reference. As an array is also an object and it is referred by a reference variable which if set as final then cannot be reassigned. Le.....

File Handling in Java using FileReader and FileWriter

Answered on 13th Aug, 2018, 0 Views

Java Byte streams are used to perform input and output of 8-bit bytes, whereas Java Character streams are used to perform input and output for 16-bit unicode. Though there are many classes related to character streams but the most frequently used classes are, FileReader and FileWriter. Though internally FileReader uses FileInputStream and FileWriter uses FileOutputStream but here the major .....

Extracting each word from a string using Regex in Java

Answered on 13th Aug, 2018, 0 Views

A word represents continous letters from a to z or A to Z. Using Regex that matches any letter from a-z and A-Z will suffice the need. We'll use the following regex pattern − , [a-z] matches any character from a to z. [A-Z] matches any character from A to Z. + matches 1 or more characters from the group. , This will produce the following result − ,

Enum with Customized Value in Java

Answered on 13th Aug, 2018, 0 Views

An enum in java represents a group of named constants. It can also have custom properties and methods. Let us look at an example. , This will produce the following result − , Here we've added a price as field and showPrice() as method to Enum. We've assign custom values to enum using its constructor.

Dynamic method dispatch or Runtime polymorphism in Java

Answered on 13th Aug, 2018, 0 Views

Runtime Polymorphism in Java is achieved by Method overriding in which a child class overrides a method in its parent. An overridden method is essentially hidden in the parent class, and is not invoked unless the child class uses the super keyword within the overriding method. This method call resolution happens at runtime and is termed as Dynamic method dispatch mechanism. Let us look at.....

Difference between HashTable and HashMap in Java

Answered on 13th Aug, 2018, 0 Views

Following are the notable differences between HashTable and HashMap classes in Java.   HashTable HashMap Synchronized HashTable is synchronized. HashMap is not synchronized. Thread Safe HashTable is thread safe. HashMap is not thread safe. Null objects HashTable does not allows null keys or null values. HashMap allows one null key and multiple null values. Performance HashTable is fas.....

Default constructor in Java

Answered on 13th Aug, 2018, 0 Views

Java compiler automatically creates a default constructor (Constructor with no arguments) in case no constructor is present in the java class. Following are the motive behind a default constructor. Create the Object Call the super class constructor() Initialize all the instance variables of the class object.  Live Demo , ,

Counting number of whitespaces in text file using java

Answered on 13th Aug, 2018, 0 Views

We can read whitespaces in a file by reading it in a string and then splitting based on "\\s+" pattern. It includes the whitespaces and \r\n characters. See the example below: Consider the following text file in classpath. , , This will produce the following result − ,

Architecture of the Internet

Answered on 13th Jul, 2018, 0 Views

The architecture of the Internet is ever-changing due to continuous changes in the technologies as well as the nature of the service provided. The heterogeneity and vastness of the Internet make it difficult to describe every aspect of its architecture. The overall architecture can be described in three levels: Backbone ISP (Internet Service Provider)Regional ISPsClientsThe following diagra.....

Previous 1 ... 3 4 5 6 7 8 9 ... 13 Next
loader
Advertisements
Contribution

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.