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

What is setter method in java

setter method:   class Bank { private int minimumbalance=2500;   public int setminimumBalance(int value)//setter method { this.minimumbalance=value;//minimumbalance=10000 System.out.println(minimumbalance); } }   class Accountholder { public static void main(String args[]) { Bank bb=new Bank(); bb.setminimumBalance(10000);   }}  

What is encapsulation in java

Encapsulation:[Bundling of fields[variables] and method inside a single class]   adv: It prevents outer classes from accessing and changing the fields of a class   getter & setter methods in java[POJO class]==>plain old java objects   gettermethod–>there must be a returntype other than void   class Bank { private int minimumbalance=2500;   public int getminimumBalance()//getter […]

How to Remove duplicates in java

Remove duplicates:   {1,2,2,3,4,4,5}   output: 1 2 3 4 5 Program class Removeduplicates { public static void main(String args[]) { int arr[]={1,2,2,3,4,4,4,5};   int temp[]=new int[5];//0-4   int j=0;   for(int i=0; i<arr.length-1; i++)0<7 { if(arr[i]!=arr[i+1])1 not equals 2 { temp[j++]=arr[i];temp[0]=1 2 } } temp[j++]=arr[arr.length-1];   for(int i=0;i<j;i++) { System.out.println(temp[i]+” “); } }}

What is OOPS in java language

Abstract class Interface   The abstract keyword is used to The interface keyword is used to declare the abstract class—————— declare the interface   ——————————————————————————– Abstract class can have abstract————-interface can have only abstract and non-abstract methods methods ———————————————————————————- Abstract class doesn’t support interface will support multiple multiple inheritance inheritance ———————————————————————————– An Abstract class can […]

What is Abstraction in java

Abstraction:   Data Abstraction is the process of hiding certain details and showing only the essential information to the user   Abstraction can be achieved either with abstract class or interface in java   Program abstract class Student { abstract void paperarrear();//abstract method   void colgatn()//non abstract method { System.out.println(“He will atn the cls regularly”); […]

Simple java important interview questions

35. What are design patterns? Design patterns are reusable solutions to common software design problems. Examples: Singleton, Factory, Observer.   36. Explain the Singleton design pattern. Restricts a class to one instance and provides a global access point to it. java CopyEdit class Singleton { private static Singleton instance; private Singleton() () public static Singleton […]

Java simple important interview questions

17. What is exception handling? How is it implemented in Java? Exception handling manages runtime errors using try, catch, throw, throws, and finally. 18. Differentiate between throw and throws keywords. throw: Used to explicitly throw an exception. throws: Declares exceptions a method might throw. 19. What are checked and unchecked exceptions? Checked: Checked at compile-time […]

Java important interview questions

12. Describe the access modifiers in Java. Public: Accessible everywhere. Protected: Accessible within the same package and subclasses. Default: Accessible within the same package only. Private: Accessible within the same class only.   13. What is encapsulation? How is it implemented in Java? Encapsulation is bundling data (variables) and methods into a single unit (class). […]

Simple and important Java interview questions

7. What are constructors in Java? How are they different from methods? Constructors: Special methods to initialize objects. Name matches the class. No return type. Difference from methods: Methods perform actions; constructors initialize objects.   8. Explain method overloading and method overriding with examples. Overloading: Same method name, different parameters (compile-time polymorphism). java CopyEdit class […]

Java important simple interview questions

1. What is Java? Explain its features.   Java is a high-level, object-oriented programming language developed by Sun Microsystems (now Oracle) in 1995. Key features: Platform Independent: Write Once, Run Anywhere (WORA). Object-Oriented: Follows OOP principles like encapsulation and inheritance. Robust: Strong memory management and exception handling. Multithreaded: Supports concurrent execution of threads. Secure: No […]

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