Interface program: An Exquisite program
Interface Luminious Object has two method lightOn() and lightOff(). There is one class Solid extended by 2 classes Cube and Cone. There is one class LuminiousCone extends Cone and implements Luminoius Interface. LumminuiousCube extends Cube and implements Luminious Interface. Create a object of Lumi
Download free Sample papers
Write a program that illustrate the use of interface reference.
Interface Luminious Object has two method lightOn() and lightOff(). There is one class Solid extended by 2 classes Cube and Cone. There is one class LuminiousCone extends Cone and implements Luminoius Interface. LumminuiousCube extends Cube and implements Luminious Interface. Create a object of LuminiousCone and LuminousCube and use the concept of interface reference to invoke the methods of interface.
interface Luminious
{
void LightOn();
void LightOff();
}
class Solid
{}
class Cone extends Solid
{}
class Cube extends Solid
{}
class LuminiousCone extends Cone implements Luminious
{
public void LightOn()
{
System.out.println("Light on from Cone");
}
public void LightOff()
{
System.out.println("Light off from Cone");
}
}
class LuminiousCube extends Cube implements Luminious
{
public void LightOn()
{
System.out.println("Light on from Cube");
}
public void LightOff()
{
System.out.println("Light off from Cube");
}
}
public class Practical16
{
public static void main(String[] agrs)
{
Luminious LCube = new LuminiousCube();
LCube.LightOn();
LCube.LightOff();
Luminious LCone = new LuminiousCone();
LCone.LightOn();
LCone.LightOff();
}
}
Watch java videos
Related Posts
Continue learning with these related articles

Logic Gates for ISC Class 11: Truth Tables, Universal Gates, Half and Full Adder
ISC Class 11 Computer Science notes on logic gates: AND, OR, NOT, NAND, NOR, XOR and XNOR with truth tables, why NAND and NOR are universal gates, and half adder and full adder circuits with their Boolean expressions.
Decimal to Binary Conversion in Java: 3 Programs with Examples
How to convert a decimal number to binary on paper and in Java: three programs (String, place value and Integer.toBinaryString), binary to decimal, a dry run and common mistakes.

ISC Class 11 Computer Science Sample Paper 2026-27 with Solutions
A full 70-mark ISC Class 11 Computer Science sample paper for the 2026-27 annual exam: MCQs, number systems, propositional logic, logic gates, Java classes, arrays, strings, searching and sorting, and computing ethics, with complete worked solutions.