😎Hey, thanks for watching! We’d love to know your thoughts/doubts here in the comments. 🔴 To learn Android App Development online with regular LIVE CLASSES, enroll now: forms.gle/qvhLEnfeUo8NadJM8 👉For professional self-paced certification courses (pre-recorded), visit: bit.ly/Pre-Recorded-Course 👉Don’t forget to SUBSCRIBE our channel for more such videos & valuable content: bit.ly/TH-cam-WsCubeTech
jin logo ka itel i.j main alag alag class bna kr extend krny ma errors a rhy han then you can write it like this too package Main; public class practise extends ClassA { public static void main(String[]args){ practise practise = new practise(); int sum = practise.multiply (8,7); System.out.println("The sum is: "+sum); } } class ClassA extends ClassB{ public int operations(int a,int b){ return a+b; } } class ClassB{ public int multiply( int a,int b ){ return a*b; } }
public class superClass{ int a=7; public void add(int a, int b){ return a+b; } } public class subClass extends superClass{ public static void main(String[] args){ subClass s = new subClass(); System.out.println("Programmer salary is:"s.a"); System.out.println("Bonus of Programmer is:"+s.add); } }
You switched directly from Note pad to android studio but didn't tell how to handle it ... run in console...how to run without using mainActivity file...that's confusing.
@@hemant64616 Android studio pe ni... Actually multi classes file jesey inheritance, method overriding etc me diqat hui... Na cmd me chal rha tha na Android studio me... So in Android studio I run as run with convergance then it worked.
now i got it agr kisi k ye nhi sh horha then try this public class Main { public static void main(String[] args) { SubClass s = new SubClass(); System.out.println("Programmer salary is: " + s.a); System.out.println("Bonus of the programmer is: " + s.add(5, 6)); } } class SuperClass { int a = 7; public int add(int a, int b) { // Specify the return type as int return a + b; // Return the sum of a and b } } class SubClass extends SuperClass {
😎Hey, thanks for watching! We’d love to know your thoughts/doubts here in the comments.
🔴 To learn Android App Development online with regular LIVE CLASSES, enroll now: forms.gle/qvhLEnfeUo8NadJM8
👉For professional self-paced certification courses (pre-recorded), visit: bit.ly/Pre-Recorded-Course
👉Don’t forget to SUBSCRIBE our channel for more such videos & valuable content: bit.ly/TH-cam-WsCubeTech
Hidden best android development course.. in depth video about java .. thankk you so much 😀
It's not hidden bro
Gajab ka teaching techniques hai bhai. Thank you
good explanation thank you sir for this video
Thank you
thanks sir
very nice
Thnx bhai sir
jin logo ka itel i.j main alag alag class bna kr extend krny ma errors a rhy han then you can write it like this too
package Main;
public class practise extends ClassA {
public static void main(String[]args){
practise practise = new practise();
int sum = practise.multiply (8,7);
System.out.println("The sum is: "+sum);
}
}
class ClassA extends ClassB{
public int operations(int a,int b){
return a+b;
}
}
class ClassB{
public int multiply( int a,int b ){
return a*b;
}
}
nice
Java supports multiple inheritance with the help of class it is not possible.
but,
With the help of interface it is Possible.
interface?
public class superClass{
int a=7;
public void add(int a, int b){
return a+b;
}
}
public class subClass extends superClass{
public static void main(String[] args){
subClass s = new subClass();
System.out.println("Programmer salary is:"s.a");
System.out.println("Bonus of Programmer is:"+s.add);
}
}
Sir can we write two class in one file....?
❤❤❤
You switched directly from Note pad to android studio but didn't tell how to handle it ... run in console...how to run without using mainActivity file...that's confusing.
bro vo intelijeidie pr kr rhe hai java ke code confuse mat ho
@@hemant64616 Android studio pe ni... Actually multi classes file jesey inheritance, method overriding etc me diqat hui... Na cmd me chal rha tha na Android studio me... So in Android studio I run as run with convergance then it worked.
bhayi us par bhi nhi horha buht masla h
now i got it agr kisi k ye nhi sh horha then try this
public class Main {
public static void main(String[] args) {
SubClass s = new SubClass();
System.out.println("Programmer salary is: " + s.a);
System.out.println("Bonus of the programmer is: " + s.add(5, 6));
}
}
class SuperClass {
int a = 7;
public int add(int a, int b) { // Specify the return type as int
return a + b; // Return the sum of a and b
}
}
class SubClass extends SuperClass {
}