KnpCode
Java, Spring, BigData, Web development tutorials with examples
 
Skip to content
  • Ubuntu
  • Big Data
    • Hadoop Tutorials
  • Java
    • Core Java Tutorials – Beginner
    • Core Java Tutorials – Advanced
    • Java Programs
  • spring
    • Spring Framework
Home Java Archive by category "java-basics"

Category: java-basics

Private Methods in Java Interface

UshaK December 28, 2020 December 28, 2020java-basics java-basics 0

In Java 8 two new features were added to the interfaces in Java- Default methods and static methods. Java 9 added one more capability of adding private methods to the interfaces in Java. Interface private method in Java Private methods in Java interfaces can be defined using private modifier the…

Continue reading

Method Overloading in Java

UshaK December 12, 2020 December 16, 2020java-basics java-basics 0

In Java you can have two or more methods having the same name with in the same class provided their arguments differ in either type or number. These types of methods are called overloaded methods and the process is known as method overloading in Java. Method overloading in Java –…

Continue reading

super in Java With Examples

UshaK November 12, 2020 December 22, 2020java-basics java-basics 0

Super keyword in Java is used to refer to the immediate parent class of the sub class. You can use super keyword in Java in following ways- You can invoke the constructor of the parent class, doing that using super makes your code more compact and classes are better encapsulated.…

Continue reading

static in Java With Examples

UshaK November 11, 2020 December 21, 2020java-basics java-basics 0

Static keyword in Java is used to create variables and methods that are associated with the class rather than with any object of the class. Table of contents Static in Java static variables in Java Static variables usage static methods in Java static method access restrictions Static method usage Static…

Continue reading

Java Ternary Operator With Examples

UshaK November 10, 2020 December 21, 2020java-basics java-basics 0

In the post conditional operators in Java we talked about the Conditional-AND and Conditional-OR operators, here we’ll talk about another conditional operator known as ternary operator in Java (?:). Ternary operator uses three operands thus the name ternary operator and it can be used in place of if-else statement or…

Continue reading

Java Conditional Operators With Examples

UshaK November 9, 2020 December 21, 2020java-basics java-basics 0

There are two conditional operators in Java- && (known as Conditional-AND) and || (known as Conditional-OR). Both Conditional-AND (&&) and Conditional-OR (||) operators in Java perform operations on two boolean expressions and return a boolean value. Conditional-AND– In case of && operator in Java if any of the two boolean…

Continue reading

Java Operators: Equality And Relational

UshaK November 8, 2020 December 21, 2020java-basics java-basics 0

The equality and relational operators in Java are used to determine if value of one operand is greater than, less than, equal to, or not equal to the value of another operand. These operators return a boolean value determining whether a comparison is true or false. For example- if(5 >…

Continue reading

Java Operators: Assignment, Arithmetic And Unary

UshaK November 7, 2020 December 21, 2020java-basics java-basics 0

This post shows the assignment, arithmetic and unary operators available in Java. Table of contents Assignment operator in Java Arithmetic operators in Java Java arithmetic operators example Overloaded + operator for String Compound assignment in Java Java Compound assignment example Unary operators in Java Java Unary operators example Increment and…

Continue reading

File Name Same as Class Name in Java

UshaK November 6, 2020 December 21, 2020java-basics java-basics 0

If you are reading the beginning chapter of any Java book or seeing any first Java program example online, one thing you will notice is that file name should be same as the class name in Java. In this post we’ll see how true is the statement that the file…

Continue reading

Why main Method static in Java

UshaK November 5, 2020 December 21, 2020java-basics java-basics 0

When you write any Java program it’s starting execution point is the main method which has a form as following. Public static void main(String[] args) Given this signature of main method in Java the question arises why main method is public, void and static in Java. It is asked quite…

Continue reading

123›»
Privacy Policy | Disclaimer
Powered by Nirvana & WordPress.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.OkPrivacy Policy