Sai Subramanyam has Published 99 Articles

Can a constructor be overridden in java?

Sai Subramanyam

Sai Subramanyam

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

15K+ Views

If super class and sub class have same methods including name, return type and parameters, and if you try to call it using the object of the sub class Then the method in the sub class is invoked. Constructor looks like method but it is not. It does not have ... Read More

How to print new line in Java?

Sai Subramanyam

Sai Subramanyam

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

2K+ Views

The java.io.PrintStream.println() method prints an array of characters and then terminate the line. This method behaves as though it invokes print(char[]) and then println(). Using this method you can print the data on the console. import java.io.*; public class PrintStreamDemo { public static void main(String[] args) ... Read More

What is the difference between compile time errors and run time errors in Java?

Sai Subramanyam

Sai Subramanyam

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

486 Views

Compile time errors are syntactical errors in the code which hinders it from being compiled. Example public class Test{ public static void main(String args[]){ System.out.println("Hello") } } Output C:\Sample>Javac Test.java Test.java:3: error: ';' expected ... Read More

Edit report generated from SAP Crystal Reports

Sai Subramanyam

Sai Subramanyam

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

407 Views

It does not seem to be feasible to edit the report once generated. You cannot add a constraint or logic to allow your report to be editable.But there does exist a work around, what you can do is: First export the report and then you can change the mode of ... Read More

When to use vararg methods in Java?

Sai Subramanyam

Sai Subramanyam

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

204 Views

Whenever, you want to pass different number of arguments each time you call a method you should use vararg methods. This example creates sumvarargs() method which takes variable no of int numbers as an argument and returns the sum of these arguments as an output. Example Live Demo ... Read More

What are number format exceptions in Java?

Sai Subramanyam

Sai Subramanyam

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

204 Views

This Exception happens once you associated convert a string variable in an incorrect format to a whole number (numeric format) that's not compatible with one another. Example public class Test { public static void main(String[] args) { int data = ... Read More

Comparing SAP ABAP Field symbols and data reference with Pointers in C

Sai Subramanyam

Sai Subramanyam

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

851 Views

Field symbol resembles pointer in C but there is one main difference: you can use Field Symbol only to access the values present in it but not the memory address. Similar to a pointer in actual, it stores the memory address of the variable that was assigned to it. You ... Read More

Does finally always execute in Java?

Sai Subramanyam

Sai Subramanyam

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

394 Views

The finally block follows a try block or a catch block. A finally block of code always executes, irrespective of occurrence of an Exception.

Replace Tab with space in SAP ABAP

Sai Subramanyam

Sai Subramanyam

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

681 Views

You just need to make a small change. You need to add an “If condition” for handling the tab as shown below − if CO gc_hex_char I think it should sort out your issue and neither it looks like hardcoding or a wrong implementation.

How do we pass parameters by value in a Java method?

Sai Subramanyam

Sai Subramanyam

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

301 Views

Passing Parameters by Value means calling a method with a parameter. Through this, the argument value is passed to the parameter. Example public class SwappingExample { public static void swapFunction(int a, int b) { int c = a+b; ... Read More

Advertisements