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 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 code to find bank details

Create a class BankAccount with attributes account holder name,account number and balance. Include a methods for deposit and withdrawal   class BankAccount { String Holdername; int AccountNo; int Balance;   void deposit(int amount)amount=3000 { Balance+=amount;//8000 }   void withdrawal(int amount)//1000 { if(amount<=Balance)//1000<=8000 Balance-=amount;//7000 else System.out.println(Insufficient Balance”); }   void display() { System.out.println(Balance);//7000 }   } […]

✅ Java Code: Sum of All Nodes (Minimal Version)

Here is a simple and short Java program to find the sum of all nodes in a binary tree using recursion: ✅ Java Code: Sum of All Nodes (Minimal Version) class Node { int data; Node left, right; Node(int data) { this.data = data; } }   public class SumOfNodes {   int sum(Node node) […]

Java Code: Height of Binary Tree

Java Code: Height of Binary Tree Here’s a simple Java program to find the height of a Binary Tree:   ✅ Java Code: Height of Binary Tree // Definition for a binary tree node class Node { int data; Node left, right;   public Node(int item) { data = item; left = right = null; […]

Java important practice programs

  TCS Codings – 2 def find_equilibrium_index(arr):     total_sum = sum(arr)     left_sum = 0       for i in range(len(arr)):         # right_sum = total_sum – left_sum – arr[i]         if left_sum == (total_sum – left_sum – arr[i]):             return […]

Java counting number program in queue

Count the number of vowels in the given string by using queue   import java.util.*; class Count { public static void main(String args[]) { String input=”queue”;//4   Queue<Character> q=new LinkedList<>();   int count=0;   for(char ch:input.toCharArray())//e { q.add(ch);//e }   while(!q.isEmpty())//true { char ch=q.remove(); if(“aeiouAEIOU”.indexOf(ch)!=-1)//indexof returns -1 if value is not found { count++; } […]

Java linked list simple program for practice

create a linkedlist and add 5 integer elements to that.calculate and print the sum of odd elements of the list   1 2 3 4 5   class Main { public static void main(String[] args) { LinkedList<Integer> list = new LinkedList<>(); for(int i = 1; i<=5; i++){ list.add(i);//1 2 3 4 5 } int sum […]

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);   […]

Java practice programs with example

    Question 2 : Reverse Prefix of Word(Using Stack)   Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If the character ch does not exist in word, do nothing.   For […]

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