Java Enums

Java Enums is a special java class that defines a collection of constants. Constants are the values that are fixed and cannot be changed. Constants are similar to final variables. Enum is referred to enumeration of a set of named constants. Enums are similar to classes and can have their own methods and attributes other … Read more

Java Method

Java Method is a piece of code that performs function assigned to it. It runs only when it is called. Method is a part of java class. It is also called as function. Methods provide code reusability. There are two types of java methods: User defined Methods Standard Library Methods User Defined Java Method A … Read more

Java Input and Output

Java Input and output are user interactions. Java Programming language allows to take input from user and display output.

Java Inner Class

Java allows nested classes so that programmer can write a class within a class. Other than methods and variables as class members, a class can also contain classes as its members. Nested Classes The class inside another class is a Java Inner Class. Inner classes can have private and protected access types, unlike regular classes. … Read more

Java Packages

Java Package is a group of related types (classes, interfaces, enumerations, annotations and sub packages). Programmer can either create his/her own package or use the pre defined packages provided in JDE. Subpackage A package can have multiple packages inside it. A subpackage is the package inside a package. To further categorize a package, we use … Read more

Java File Handling

Java programming language provides functionality to handle files through code. Other than printing the results on the command line, programmer can also save results or read data from files. This is called File Handling. For this purpose, Java programming language has java.io package. The File class in java.io package helps user to handle files. Java File … Read more

Java Exceptions

Java Exception handling refers to three keywords: try, catch and throw. While programming in Java, there often comes scenarios when command prompt shows error. Errors occur when there is some problem in the code and it cannot be compiled. There can be different reasons for errors, such as: Syntax error JVM ran out of memory File cannot … Read more

Java RegEx

Java RegEx , Regular Expressions is a search pattern that contains sequence of characters. RegEx is used to search for words or characters in a text body. User creates specific search patterns to get the desired data. RegEx perform the process of searching and replacing the data. To create a Java Regex, user can use … Read more

Java Data Structures

The Java utility package provides java wide range of Java data structures. These data structures perform various designated functions. Basically, data structures provide memory space to create, store and organize data. Types of Java Data Structures There are two types of Java Data Structures: Primitive Data Structures Non Primitive Data Structures Primitive Data Stuctures Primitive … Read more

Java Interfaces

Java Interface is a reference type. An interface is same as a class. The major difference is that Interface uses the keyword interface instead of class keyword. An interface is an abstract class. It contains abstract methods. Other than abstract methods, an interface also contains constants and default methods. Unlike classes, interfaces do not have … Read more