0

public class Program { public static void main(String[] args) { int a=5; int b=2; int f=+a+b; System.out.pri

What problem can't print f https://code.sololearn.com/cWmN6V2eN4rn/?ref=app

7th Apr 2019, 7:51 AM
Vignesh R
Vignesh R - avatar
3 ответов
0
And you can remove + infront of a+b if you want because it do nothing anyway
7th Apr 2019, 8:36 AM
JavaBobbo
JavaBobbo - avatar
0
class MNOP extends ABCD { int x = 30; static int y = 40; public String getName() { return "MNOP"; } } public static void main(String[] args) { System.out.println(new MNOP().x + ", " + new MNOP().y); ABCD a = new MNOP(); System.out.println(a.x); // 10 System.out.println(a.y); // 20 System.out.println(a.getName()); // MNOP } How to access parent class getname method What happen if do downcasting
8th Apr 2019, 4:17 AM
Vignesh R
Vignesh R - avatar