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 example program for subclass

Java program class Hospital { String name; Hospital(String name) { this.name=name;//name:Apollo hospital } } //————————- class Doctor { String doctorname;//attributes Doctor(String doctorname)//constructor { this.doctorname=doctorname;//doctorname=Dr.kelwin } void worksIn(Hospital a)//a=apollo { System.out.println(doctorname+” working in “+a.name); } } class Association { public static void main(String args[]) { Hospital apollo=new Hospital(“Apollo hospital”);   Doctor d1=new Doctor(“Dr.kelwin”);   d1.worksIn(apollo); } […]

Final variable in java

Final variables==> final variables means constant–>once assigned,its value cannot be changed   class Finalvariables { final int speedlimit=60;   void display() { //speedlimit=70;//error System.out.println(“speed limit=” +speedlimit); } public static void main(String args[]) { Finalvariables object=new Finalvariables(); object.display(); }}  

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

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