Leave a Reply 5

Your email address will not be published. Required fields are marked *


krishna

krishna

c=0 b=false f=0.0

Ashutosh

Ashutosh

default value of char is (Blank space).
output will be :
c= b=false f=0.0

renko

renko

Output:
c =
c = false
c = 0.0

Code:
public class FieldInit {
char c;
boolean b;
float f;
public void printAll() {
System.out.println(“c = ” + c);
System.out.println(“c = ” + b);
System.out.println(“c = ” + f);
}
public static void main(String[] args) {
FieldInit fI = new FieldInit();
fI.printAll();
}
}