In Java, the ternary operator is a type of Java conditional operator. In this section, we will discuss the ternary operator in Java with proper examples. The meaning of ternary is composed of three parts. The ternary operator (? 🙂 consists of three operands. It is used to evaluate Boolean expressions. The operator decides which value will be assigned to the variable. ItContinue reading “Ternary Operator in Java”
Author Archives: Suganthank
Multilevel Inheritance in Java
The multi-level inheritance includes the involvement of at least two or more than two classes. One class inherits the features from a parent class and the newly created sub-class becomes the base class for another new class. When a class extends a class, which extends anther class then this is called multilevel inheritance. For example class CContinue reading “Multilevel Inheritance in Java”
Top Five Inspiration People in Tech
RICHARD STALLMAN Stallman Achievements: 1. The person who creat the GNU project and give a clarification for peoples to know their freedom in software world. 2. Founded the Free Software Foundation (FSF) in October 1985. 3. Stallman pioneered the concept of copyleft, which uses the principles of copyright law to preserve the right to useContinue reading “Top Five Inspiration People in Tech”
INTERFACE
Another way to achieve abstarction in Java, is with interfaces. What is interface? Interfaces form a contract(Set of rules) between the class and the outside world, and this contract is enforced at build time by the compiler. An interface(completely “abstract class“) is a group of related methods with empty bodies. To implements this interface, the name ofContinue reading “INTERFACE”
Constructors in Java
A constructor in Java is a special method that is used to initialize objects. The constructor is called when an object of a class is created. It can be used to set initial values for object attributes. In Java, a constructor is a block of codes similar to the method. It is called when an instanceContinue reading “Constructors in Java”
Recursion
Recursion is the technique of making a function call itself. This technique provides a way to break complicated problems down into simple problems which are easier to solve. Recursion may be a bit difficult to understand. The best way to figure out how it works is to experiment with it. A condition must be specifiedContinue reading “Recursion”
Method Overriding
If subclass (child class) has the same method as declared in the parent class, it is known as method overriding in Java. In other words, If a subclass provides the specific implementation of the method that has been declared by one of its parent class, it is known as method overriding. Usage of Java Method OverridingContinue reading “Method Overriding”
Method Overloading
If a classhas multiple methods having same name but different in parameters, it is known as Method Overloading. If we have to perform only one operation, having same name of the methods increases the readability of the program. Suppose you have to perform addition of the given numbers but there can be any number of arguments, if youContinue reading “Method Overloading”
OOPS CONCEPT
Java – What is OOP? OOP stands for Object-Oriented Programming. Procedural programming is about writing procedures or methods that perform operations on the data, while object-oriented programming is about creating objects that contain both data and methods. Object-oriented programming has several advantages over procedural programming: Java – What are Classes and Objects? Classes and objects areContinue reading “OOPS CONCEPT”
Java Break/continue
Java Break The Java break statement is used to break loop or switch statement. It breaks the current flow of the program at specified condition. In case of inner loop, it breaks only inner loop. We can use Java break statement in all types of loops such as for loop, while loop and do-while loop. TheContinue reading “Java Break/continue”