Java Conditional Statements

Java conditional statements are the keywords that execute depending on the conditions defined by programmer. Often there comes a situation where a program needs to take a decision based on the user input or based on some pre defined conditions. In those cases decision making tools are required. Java provides conditional statements that help achieve … Read more

Java Inheritance

Java is object oriented programming OOP language so it provide the feature of Java Inheritance. Inheritance is the process of inheriting some or all feature of a class by another class. Inheritance provides a hierarchal structure to the code. Class features can be variables and methods. Inheritance works between classes. The classes in Java inheritance … 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 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 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 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 Events

An event is defined as the change in the state of object. Java Events control the change in the state of object in GUI (Graphical User Interface) programming. Events occur when front end user interacts on GUI level of the system. For example, an event is generated when user clicks on a button, scrolls the … Read more

Java Multithreading

Java is a multithreaded programming language. Java multithreading refers to having multiple threads that can run concurrently (at the same time). It is also know as Concurrency in Java. Each thread is a single executable piece of code that runs parallelly to other threads. Life cycle of a thread A life cycle of a thread … Read more

Java Reflection

Java Reflection is an API. This API is used to examine or modify the run time behavior of a class, method or interface. This scenario is called Java Reflection. The packages that provide tools for Java Reflection are java.lang and java.lang.reflect packages. These packages further contain the classes like java.lang.Class. This class contains methods that … Read more

Java Break and Continue

Java break and continue statements are jump statements that ignore some piece of code and jump to the next piece of code. These keywords are used inside loops like while, do while loops and switch statements. Java Break Java break statement is used in switch statements. The break keyword breaks the loop and jumps out … Read more