Syed Javed has Published 17 Articles

How is down-casting possible in Java?

Syed Javed

Syed Javed

Updated on 12-Mar-2020 10:34:57

178 Views

Yes, a variable can be downcast to its lower range substitute by casting. It may lead to data loss although. See the example below −ExampleLive Demopublic class Tester {      public static void main(String[] args) {       int a = 300;         byte b = (byte)a;         System.out.println(b);    }   }OutputIt will print output as −44

How to use for each loop through an array in Java?

Syed Javed

Syed Javed

Updated on 12-Mar-2020 10:20:25

309 Views

JDK 1.5 introduced a new for loop known as foreach loop or enhanced for loop, which enables you to traverse the complete array sequentially without using an index variable.ExampleLive Demopublic class ArrayUsingForEach {    public static void main(String[] args) {       double[] myList = {1.9, 2.9, 3.4, 3.5};       for (double element: myList) {          System.out.println(element);       }    } }Output1.9 2.9 3.4 3.5

Advantages of naming conventions in Java

Syed Javed

Syed Javed

Updated on 06-Mar-2020 05:38:32

536 Views

Following the the best practices while declaring a variable.  These best practices maintains code readability, understandability as project code size increases.Variables names should be short or long enough as per the scope. For example, loop counter variable, i is fine whereas employee as loop variable.Specific words should not be used ... Read More

Infinite while loop in Java

Syed Javed

Syed Javed

Updated on 27-Feb-2020 05:25:01

567 Views

Yes. Following while loop is a valid statement and causes an infinite loop.while(true);

What is static blank final variable in Java?

Syed Javed

Syed Javed

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

467 Views

No. It is not allowed in Java. Compiler will fail the compilation throwing error that the blank final field may not have been initialized.

How the Table statement works in ABAP

Syed Javed

Syed Javed

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

362 Views

With table statement, you are able to get a single line of data corresponding to the dictionary structure you specify. The fields of structure can be used as select options and the structure can be passed as variable in the program.

Running T-code me51n again in SAP system throws an error

Syed Javed

Syed Javed

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

285 Views

Try using breakpoint on my include in EXIT_SAPLMEREQ_010 and check if it gets to breakpoint on the second run.It could be possible that error gets stuck due to standard SAP procedure. Try to run this T-code: me51n in different environments and check if it works fine.

Advertisements