Java Program to Find Season Using Switch Statement

This is a Java Program to Find Season Using Switch Statement. The switch statement is Java’s multi way branch statement. It provides an easy way to dispatch execution to different parts of your code based on the value of an expression. We take the month as an input. The value of the input is compared … Read more

advertisement

Java Program to Find Area of Square, Rectangle and Circle using Method Overloading

This is a Java Program to Find Area of Square, Rectangle and Circle using Method Overloading. We declare three methods of same name but with different number of arguments or with different data types. Now when we call these methods using objects, corresponding methods will be called as per the number of arguments or their … Read more

advertisement

Java Program to Perform Arithmetic Operations

Java Arithmetic Operators are used to perform basic mathematical operations on numerical data types, such as integers and floating-point numbers. These operators can be classified into two categories: unary and binary operators. The most common arithmetic operators are addition (+), subtraction (-), multiplication (*), division (/), and Modulus (%). Problem Description Write a Java program … Read more

advertisement

Java Program to Convert Integer Values into Byte, Character, Float

This is a Java Program to Convert Integer Values into Byte, Character, Float. Enter any integer as input. After that we convert the given integer into byte and char by type casting (Explicit casting) but we can directly convert int value to float value as java itself performs this type of type casting (Implicit casting). … Read more

advertisement

Java Program to Convert Long Values into Byte

This is a Java Program to Convert Long Values into Byte. Enter any long integer as an input. After that we convert the given long integer into byte using explicit type casting. Here is the source code of the Java Program to Convert Long Values into Byte. The Java program is successfully compiled and run … Read more

advertisement

Java Program to Calculate Sum of Two Byte Values using Type Casting

This is a Java Program to Calculate Sum of Two Byte Values Using Type Casting. Type casting in Java is to cast one type, a class or interface, into another type i.e. another class or interface. Enter any two byte values as input. After that we first convert these two bytes into integer using type … Read more

advertisement

Java Program to Illustrate Use of Pre and Post Increment and Decrement Operators

This is a Java Program to Illustrate Use of Pre and Post Increment and Decrement Operators.The increment (++) operator increases its operand by one. The decrement (–) operator decreases its operand by one. Enter an integer as input. After that we perform the pre and post increment and decrement operators on the given integer and … Read more

advertisement

Relational Operators in Java

Relational Operators in Java are used to compare two values and determine their relationship, resulting in either true or false based on the comparison. List of Relational Operators in Java: Equal to (==) Not equal to (!=) Greater than (>) Less than (<) Greater than or equal to (>=) Less than or equal to (<=) … Read more

advertisement

Java Program to Return a Value from a Method

This is a Java Program to Return a Value from a Method. We make a method named input which is used to get input from the user. We also make a method named add which is used to perform addition and return the result back to input method where we finally print the result. Here … Read more

advertisement

Java Program to Show the Nesting of Methods

This is a Java Program to Show the Nesting of Methods. When a method in java calls another method in the same class, it is called Nesting of methods. Enter length, breadth and height as input. After that we first call the volume method. From volume method we call area method and from area method … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.