EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Java protected Access Modifier

class ProtectedExample { protected int value=100;   protected void print() { System.out.println(“The value is=” +value); } } class Test extends ProtectedExample { public void show() { print(); } public static void main(String args[]) { Test t=new Test(); t.show(); System.out.println(t.value); }}

Hierarchical Inheritance in java oops

//Hierarchical Inheritance class Shape { float length,breadth,radius; } class Rect extends Shape {   Rect(float l,float b)   {    length=l;    breadth=b;   }   float rectangleArea()   {   return length*breadth;   } } class Circle extends Shape {   Circle(float r)   {    radius=r;   }   float circleArea()   { […]

Java Simple project Menu card

Menu Card:   1. Coffee Rs.15   2. Tea Rs.10   3. Cold Coffee Rs.25   4.MilkShake Rs.50   Enter your choice 2 You have selected Tea. Enter the quantity 3 Total amount=30 Press 1 to continue shopping or any other key to exit 3   Thank you come again.. ———————————————————————– import java.util.*; class Project […]

Without a return type and without arguments

In Java, a method can be defined with a return type and without arguments. This means the method returns a value but does not take any input parameters. ✅ General Syntax: returnType methodName() { // method body return value; // value must match returnType } In Java, methods can be categorized by whether they return […]

Java Reserved Keywords

Java Reserved Keywords: Java has a set of keywords that are reserved words that cannot be used as variables, methods, classes, or any other identifiers. For example: break, char, double, final Literal: Any constant value which can be assigned to the variable is called literal/constant. Literals in Java is a synthetic representation of boolean, numeric, […]

A program to do arithmetic operations based on the choice for any 2 integers

Here’s a Java program to perform basic arithmetic operations (+, -, *, /, %) based on the user’s choice for any two integers. import java.util.Scanner; public class ArithmeticOperations { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // Input two integers System.out.print(“Enter first number: “); int a = sc.nextInt(); System.out.print(“Enter second number: […]

Calculating marks by using java

class Marks { public static void main(String args[]) { int m1,m2,m3,m4,m5,total; float avg; System.out.println(“enter 5 marks”); Scanner s=new Scanner(System.in); m1=s.nextInt(); m2=s.nextInt(); m3=s.nextInt(); m4=s.nextInt(); m5=s.nextInt(); total=m1+m2+m3+m4+m5; avg=total/5; System.out.println(“Total=”+total); System.out.println(“Average=”+avg); if(m1>=35 && m2>=35 && m3>=35 && m4>=35 && m5>=35) { System.out.println(“Result=pass”); if(avg>=90 && avg<=100) { System.out.println(“Grade A”); } else if(avg>=80 && avg<=89) { System.out.println(“Grade B”); } else […]

To calculate the area and perimeter of the rectangle and the circle using java

The length and breadth of a rectangle and radius of a circle are input through the keyboard. Write a program to calculate the area and perimeter of the rectangle and the area & circumference of the circle Rectangle: Area==>l*b perimeter==>2(l+b) circle:   Area==>Pi*r(2) perimeter==>2pi(r) class Rectangle { public static void main(String args[]) { float l,b,r_area,r_peri,r,c_area,cir; […]

Calculating marks by using java program

If a marks obtained by a student in 5 different subject are input through the keyboard. Find out the total marks and percentage obtained by a student ————————————— import java.util.Scanner; public class StudentMarks { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // Array to store marks of 5 subjects int[] marks […]

EduLearn - Online Education Platform

Welcome to EduLearn!

Start learning today with our wide range of courses taught by industry experts. Gain new skills, advance your career, or explore new interests.

Browse Courses

Popular Courses

[Course Image]

Introduction to Programming

Learn the fundamentals of programming with Python in this beginner-friendly course.

12 Hours Beginner
[Course Image]

Data Science Essentials

Master the basics of data analysis, visualization, and machine learning.

20 Hours Intermediate
[Course Image]

Web Development Bootcamp

Build modern websites with HTML, CSS, JavaScript and popular frameworks.

30 Hours Beginner
[Course Image]

Digital Marketing Fundamentals

Learn SEO, social media marketing, email campaigns and analytics.

15 Hours Beginner
Educational Website Footer