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" (Page 2)

Category: java-basics

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

Wrapper Class in Java

UshaK November 4, 2020 December 17, 2020java-basics java-basics 0

Wrapper class in Java is a class whose object wraps a primitive type. When you need an object instead of a primitive type you can use Wrapper class to wrap the primitive type value in an object and use that object. When is Java Wrapper class needed Some of the…

Continue reading

Java BigDecimal Class With Examples

UshaK September 16, 2020 September 16, 2020java-basics java-basics 0

If you are doing some calculation in your Java application where precise value is required such as in financial operations you should not be using float or double primitive type. Same way if you want to store a very large number, for example if you are calculating factorial then again…

Continue reading

instanceof Operator in Java

UshaK September 4, 2020 February 12, 2021java-basics java-basics 0

instanceof operator in Java is used to test the type of an object during run time. The syntax of Java instanceof operator is as follows- objRef instanceof objType Here objRef is a reference to an instance. objType denotes a class type. Using instanceof operator you can check if objRef is…

Continue reading

Difference Between “==” Operator And equals() Method in Java

UshaK September 3, 2020 February 12, 2021java-basics java-basics 1

Difference between equals() method and equality operator “==” in Java is asked quite frequently in beginner level Java interviews. Since both equals() and == operator are used for comparison so it is necessary to know the differences between these two in order to ensure correct usage of one of them…

Continue reading

Type Casting And Type Conversion in Java

UshaK September 3, 2020 February 11, 2021java-basics java-basics 0

When you assign a value of one type to a variable of another data type, Java performs type conversion to accommodate the value to different type. This type conversion may happen automatically or you may need an explicit type casting to perform the type conversion. So, both of these terms…

Continue reading

‹1234›»
Privacy Policy | Disclaimer
Powered by Nirvana & WordPress.