Until Java 1.5 to read data from the user programmers used to depend on the character stream classes and byte stream classes.From Java 1.5 Scanner class was introduced. This class accepts a File, InputStream, Path and, String objects, reads all the primitive data types and Strings (from the given source) token by token using regular expressions.By default, whitespace is considered as the delimiter (to break the data into tokens).To read various datatypes from the source using the nextXXX() methods provided by this class namely, nextInt(), nextShort(), nextFloat(), nextLong(), nextBigDecimal(), nextBigInteger(), nextLong(), nextShort(), nextDouble(), nextByte(), nextFloat(), next().Passing Scanner object as a ... Read More
An exception is an issue (run time error) occurred during the execution of a program. When an exception occurred the program gets terminated abruptly and, the code past the line that generated the exception never gets executed.Exampleimport java.util.Scanner; public class ExceptionExample { public static void main(String args[]) { Scanner sc = new Scanner(System.in); System.out.println("Enter first number: "); int a = sc.nextInt(); System.out.println("Enter second number: "); int b = sc.nextInt(); int c = a/b; System.out.println("The result is: "+c); ... Read More
A static filed/variable belongs to the class and it will be loaded into the memory along with the class. You can invoke them without creating an object. (using the class name as reference). There is only one copy of the static field available throughout the class i.e. the value of the static field will be same in all objects. You can define a static field using the static keyword.Examplepublic class Sample{ static int num = 50; public void demo(){ System.out.println("Value of num in the demo method "+ Sample.num); } public static void main(String ... Read More
In computer networks, Fast Ethernet is a variation of Ethernet standards that carry data traffic at 100 Mbps (Mega bits per second) in local area networks (LAN). It was launched as the IEEE 802.3u standard in 1995, and stayed the fastest network till the introduction of Gigabit Ethernet.Fast Ethernet is popularly named as 100-BASE-X. Here, 100 is the maximum throughput, i.e. 100 Mbps, BASE denoted use of baseband transmission, and X is the type of medium used, which is TX or FX.Varieties of Fast EthernetThe common varieties of fast Ethernet are 100-Base-TX, 100-BASE-FX and 100-Base-T4.100-Base-T4This has four pairs of UTP ... Read More
Strings are used to store a sequence of characters in Java, they are treated as objects. The String class of the java.lang package represents a String.You can create a String either by using the new keyword (like any other object) or, by assigning value to the literal (like any other primitive datatype).Examplepublic class StringDemo { public static void main(String args[]) { String stringObject = new String("Hello how are you"); System.out.println(stringObject); String stringLiteral = "Welcome to Tutorialspoint"; System.out.println(stringLiteral); } }OutputHello how are you Welcome to TutorialspointStorage of ... Read More
100BASE-FX is the technical name of Fast Ethernet over fiber optic cables. It is a version of Fast Ethernet carrying data traffic at 100 Mbps (Mega bits per second) in local area networks (LAN). It was launched as the IEEE 802.3u standard in 1995. Here, 100 is the maximum throughput, i.e. 100 Mbps, BASE denoted use of baseband transmission, and FX denotes use of optical fibers in Fast Ethernet.The 100BASE-FX Physical Medium Dependent (PMD) sublayer is defined by Fiber Distributed Data Interface (FDDI).PropertiesThis has two pairs of optical fibers. One pair transmits frames from hub to the device and the ... Read More
Strings are used to store a sequence of characters in Java, they are treated as objects. The String class of the java.lang package represents a String.You can create a String either by using the new keyword (like any other object) or, by assigning value to the literal (like any other primitive datatype).Public class Sample{ Public static void main(String args[]){ String str1 = "Hello"; String str2 = "how are you"; } }Strings are immutable in Java i.e. once you create a String literal it cannot be modified.StorageSince all the String values we define ... Read More
100BASE-T4 is the early implementation of Fast Ethernet over twisted pair cables, carrying data traffic at 100 Mbps (Mega bits per second) in local area networks (LAN). It was launched as the IEEE 802.3u standard in 1995. Here, 100 is the maximum throughput, i.e. 100 Mbps, BASE denoted use of baseband transmission, and T4 denotes use of four twisted pair cables in Fast Ethernet.PropertiesThis has four pairs of unshielded twisted pair of Category 3. i.e. voice grade.Two of these pairs are bi-directional and the other two are unidirectional. The two unidirectional wires are reserved for receiving and sending data respectively. ... Read More
Strings are used to store a sequence of characters in Java, they are treated as objects. The String class of the java.lang package represents a String.You can create a String either by using the new keyword (like any other object) or, by assigning value to the literal (like any other primitive datatype).String stringObject = new String("Hello how are you"); String stringLiteral = "Welcome to Tutorialspoint";Concatenating StringsYou can concatenate Strings in Java in the following ways −Using the "+" operator: Java Provides a concatenation operator using this, you can directly add two String literalsExampleimport java.util.Scanner; public class StringExample { public ... Read More
When you install Java in your system first of all you need to set the environment variables which are path and class path.PATH− The path environment variable is used to specify the set of directories which contains executional programs.When you try to execute a program from command line, the operating system searches for the specified program in the current directly, if available, executes it.In case the programs are not available in the current directory, operating system verifies in the set of directories specified in the ‘PATH’ environment variable.You need to set path for compiler (javac.exe) and JVM(java.exe), which exists in ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP