import java.util.*;
import java.lang.*;
import java.io.*;
// this example class
class Father {
int a,b;
void daughterAge(int a) {
// a=a;// ab yyha confuse hp jayega kyuki 2 a hai
this.a=a; // ab
System.out.println(this.a);;
}
int returnDaughterAge(){
return a;
}
}
// super example class
class Mobile{
String name ;
int camera,storage;
void Specification (String name,int camera,int storage){
this.name = name;
this.storage = storage;
this.camera = camera;
}
void camera (){
System.out.println("1st camera specification \n"+camera+"M.P");
}
}
class Mobile2 extends Mobile{
void camera2(){
int camera2 = camera/2;
System.out.println("2nd camera specification \n"+camera2+"M.P");
}
}
class Main {
public static void main(String[] args) {
System.out.println("Hello world!");
/*
Father child1 = new Father();
child1.daughterAge(17);
System.out.println(child1.returnDaughterAge());
*/
// object for mobile class
Mobile redmi = new Mobile();
redmi.Specification("mi",64,256);
redmi.camera();
// mobile2 class
Mobile2 samsung = new Mobile2();
}
}
To embed this program on your website, copy the following code and paste it into your website's HTML: