Do local variables in Java have default values?

Ali
Ali
Updated on 30-Jul-2019 22:30:20

1K+ Views

No, local variables do not have default values. Once we create a local variable we must initialize it before using it. Since the local variables in Java are stored in stack in JVM there is a chance of getting the previous value as default value. Therefore, In Java default values for local variables are not allowed. Example public class Sample { public static void main(String args[] ){ int data; System.out.println(data); } } Error C:\Sample>javac Sample.java Sample.java:4: error: variable data might not have been initialized System.out.println(data); ^ 1 error

Values are not readable while calling RFC method in .net via SAP.NET Connector 2.0

John SAP
Updated on 30-Jul-2019 22:30:20

298 Views

Please check if you have same Unicode encoding in SAP and .NET Connector.

Advertisements