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 practice programs for leetcode

Create an interface Printable with a method print(), implement this interface in classes Document and photo   interface Printable { void print(); }   class Document implements Printable { void print() { System.out.println(“Document printed”); } }   class Photo implements Printable { void print() { System.out.println(“Photo printed”); } }   class Main { public static […]

Java code to create rectangle with attributes

Create a class Rectangle with attributes length and width. Use a constructor to initialize values and calculate the area   class Rectangle { int length, width;   Rectangle(int l,int w) { length=l; width=w; }   int area() { return length*width; } } class Main { public static void main(String args[]) { Rectangle r=new Rectangle(10,2); System.out.println(“Area=” […]

Java practice programs to create student details form

Create a student class with name, roll number. Use a constructor to initialize and display the student details     class Student { String name; int rollNo;   Student(String name,int rollNo) { this.name=name; this.rollNo=rollNo; }   void display() { System.out.println(name); System.out.println(rollNo); } } class Main { public static void main(String args[]) { Student s1=new Student(“John”,101); […]

Java data structures practice programs

  Traversing in binary tree   int countLeafNodes(Node root) { if(root==null) return 0;   Stack<Node> stack=new Stack<>(); stack.push(root); int leafcount=0;   while(!stack.isEmpty()) { Node current=stack.pop();   if(current.left==null && current.right==null) leafcount++; if(current.right!=null) stack.push(current.right); if(current.left!=null) stack.push(current.right); } return leafcount; }

Java data structures in binaru tree

Binary Tree: –>Binary tree is a hierarchical data structure where each node has at most 2 children left child and right child   Tree Terminology:   Node: An element in the tree. It contains data and links   Root: The topmost node in the tree(No parent)   Parent: A Node that has children   Child: […]

Java string datastructure in Linked list

import java.util.*;   class Maindsa { public static void main(String args[]) { LinkedList<String> list=new LinkedList<>();   //Add the elements to the list   list.add(“apple”); //add elements to the list list.addFirst(“banana”); //add node to the front list.addLast(“cherry”); //add node at the end   System.out.println(“Adding elements=” +list);   list.remove();//removes the first element(banana) System.out.println(“After remove method=” +list);   […]

Data structures in java

Customized stack { private int arr[];//Array to store stack elements private int top; //acts as a cursor for stack private int capacity;//maximum size of stack   //1.constructor to initialize stack public Customized stack(int size)//size=5 { arr=new int[size]; capacity=size;//capacity=5 top=-1; } //2.method for push operation(inserting data) public void push(int data)//data=20 { if(isFull()) { System.out.println(“stack is full […]

Linear data structure in java

import java.util.*; class Stacksearch { public static void main(String args[]) { Stack<String> s=new Stack<>();   //push the elements(inserting elements)   s.push(“Apple”); s.push(“Banana”); s.push(“cherry”);   System.out.println(“the elements are: +s);   String searchelement=”cherry”;   int position=s.search(searchelement);   if(position != -1) { System.out.println(searchelement +”found at the position(from top)” +position); } else { System.out.println(searchelement +”not found inside the stack”); […]

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