0

import java.awt.DisplayMode; class VariableType { int amount=20000; int pin=472442; } public class DatyTypeNK extends Variable

any one please correct this

26th Mar 2017, 10:23 AM
Ankit Khare
Ankit Khare - avatar
4 Réponses
+ 8
Can't help you... the code snippet is incomplete and idk what you want to do.
9th Apr 2017, 7:10 PM
Tashi N
Tashi N - avatar
+ 7
I'll try... - Width is an int. Don't assign a value with a leading 0 to it. I see some other problems with your assignments... Try to go through the error messages which are output at compilation or post them. - Why do you extend VariableType?
9th Apr 2017, 7:35 PM
Tashi N
Tashi N - avatar
0
import java.awt.DisplayMode; class VariableType { int amount=20000; int pin=472442; } public class DatyTypeNK extends VariableType { /** * @param args */ static VariableType VT1=new VariableType(); public static void main(String[] args) { byte byte_Var=3 ; short shortVar = 30; int Height, Width; Height= 30; Width= 05; long longVar = 60; float floatVar = 20; double doubleVar = 20.123; boolean booleanVar = true; char charVar ='N'; int a=2; int b=4; int c=a*a+b*b-b; System.out.println("Value Of byte Variable is " + byte_Var); System.out.println("Value Of short Variable is " + shortVar); System.out.println("Value Of Height " + Height); System.out.println("Value Of Width " + Width); System.out.println("Value Of long Variable is " + longVar); System.out.println("Value Of float Variable is " + floatVar); System.out.println("Value Of double Variable is " + doubleVar); System.out.println("Value Of boolean Variable is " + booleanVar); System.out.println("Value Of char Variable is " + charVar);// TODO Auto-generated method stub System.out.println("Value Of C " + c); System.out.println("Value Of C " + VT1.amount); System.out.println("Value Of C " + VT1.pin); } } any one please correct it and give the output
9th Apr 2017, 7:19 PM
Ankit Khare
Ankit Khare - avatar
0
import java.awt.DisplayMode; public class DatyTypeNK extends VariableType { /** * @param args */ static VariableType VT1=new VariableType(); static IfElse VT2=new IfElse(); public static void main(String[] args) { byte byte_Var=3 ; short shortVar = 30; int Height, Width; Height= 30; Width= 05; long longVar = 60; float floatVar = 20; double doubleVar = 20.123; boolean booleanVar = true; char charVar ='N'; int a=2; int b=4; int c=a*a+b*b-b; System.out.println("Value Of byte Variable is " + byte_Var); System.out.println("Value Of short Variable is " + shortVar); System.out.println("Value Of Height " + Height); System.out.println("Value Of Width " + Width); System.out.println("Value Of long Variable is " + longVar); System.out.println("Value Of float Variable is " + floatVar); System.out.println("Value Of double Variable is " + doubleVar); System.out.println("Value Of boolean Variable is " + booleanVar); System.out.println("Value Of char Variable is " + charVar);// TODO Auto-generated method stub System.out.println("Value Of C " + c); System.out.println("Value Of C " + VT1.amount; System.out.println("Value Of C " + VT1.pin); System.out.println("Value Of C " + VT2.a_var; } } correct it and give the output
9th Apr 2017, 8:31 PM
Ankit Khare
Ankit Khare - avatar