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 questions for learning

import java.util.*;   class ASC { public static void main(String args[]) { Scanner s=new Scanner(System.in); int amount;   while(true) { System.out.println(“enter the amount to withdraw”);//2300 amount=s.nextInt();//2300   if(amount==0) { System.out.println(“exiting…”); break; }   if(amount%100!=0)2300%100==>00!=0 { System.out.println(“Invalid amount…”); }     int a=amount/2000; amount=amount%2000;   int b=amount/500; amount=amount%500;   int c=amount/100; amount=amount%100;   if(a>0) System.out.println(a+”x2000″); if(b>0) […]

Wrapper classes in java

Wrapper classes in java:   A wrapper class in java is a class whose objects wraps or contains primitive datatypes   Need: They convert primitive datatypes into objects   In collection framework, such as Arraylist and sets,will store only objects and not primitive datatypes     Primitive datatypes Wrapper classes   char————————Character int————————-Integer float———————–Float double———————–Double […]

Java practice questions

Grocery store discount system scenario A Grocery store provides discount based on the total bill amount   Above Rs.1000: 20% discount   Rs.500 to Rs.1000: 10% discount   Below Rs.500: No discount   Write a java program that calculates the final bill amount after applying the discount   import java.util.*;   class ASC { public […]

Java practice programs

A company has installed a smart elevator system in its office building. The elevator operates based on the following rule. The elevator can move between 1st to 10th floor Users can enter their desired floor,but if the floor is outside the range,the system should print “Invalid floor” The elevator starts from 1st floor and moves […]

Java common elements in array

Find the common elements in 2 list(arraylist)   import java.util.*;   class ASC { public static void main(String args[]) {   ArrayList<Integer> a=new ArrayList<>(); a.add(1); a.add(2); a.add(3);// 1 2 3   ArrayList<Integer> b=new ArrayList<>(); b.add(4); b.add(2); b.add(5);//4 2 5   a.retainAll(b);//retainall will keep only the common values   System.out.println(a);}}

Remove duplicates in arrays of java

Remove duplicates from an array using hashset   {1, 2, 2, 3, 4, 4, 5}   import java.util.*;   class ASC { public static void main(String args[]) { int arr[]={1, 2, 2, 3, 4, 4, 5};   HashSet<Integer> s=new HashSet<>();   for(int a:arr)//a=5 { s.add(a);//s=1 2 3 4 5 } System.out.println(s);   } }

Display elements by hashset in java

Add and display the elements(4 elements) using HashSet, check if an element exists there in a hashset,remove the element..   Find the smallest and largest element(number) using treeset   class Display { public static void main(String args[]) { HashSet<String> a=new HashSet<String>();   a.add(“apple”); a.add(“mango”); a.add(“banana”); a.add(“apple”); //apple mango banana   System.out.println(“mango is there..”+a.contains(“mango”));   a.remove(“mango”); […]

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