Vikyath Ram

Vikyath Ram

96 Articles Published

Articles by Vikyath Ram

Page 10 of 10

Swapping Characters of a String in Java

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 4K+ Views

For swapping characters of a string in Java we can use string builder which is mutable so we need not to take care of new object creation during swapping. In this we would create a method which swap characters of string based on location of swapping characters.This method will take location of swapping characters as its parameters.First store both characters need to be swapped and using set character method of string builder swap the targeted characters. Example Live Demo public class SwapCharacters { public static void main(String[] args) { ...

Read More

Python program to generate all possible valid ID address from given string

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 916 Views

String is given. String contains only digit. Our task is to check all possible valid IP address combinations. Here first we check the length of the string then split by ".". Then we check the different combination of ".". Example Input : "255011123222" It's not a valid IP address. Input : 255011345890 Valid IP address is 255.011.123.222 Algorithm Step 1: First check the length of the string. Step 2: Split the string by ".". We will place 3 dots in the given string. W, X, Y, and Z are numbers from 0-255 the numbers cannot be ...

Read More

Should a constructor always have the same name as the class in java?

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 3K+ Views

Yes, the constructor should always have the same name as the class. Constructor looks like method but it is not. It does not have a return type and its name is same as the class name. Mostly it is used to instantiate the instance variables of a class. If the programmer doesn’t write a constructor the compiler writes a constructors on his behalf. Example Live Demo public class Sample{ public Sample(){ System.out.println("This is a constructor"); } public static void main(String args[]){ Sample obj = new Sample(); } } Output This is a constructor

Read More

What does abstract modifier in Java do?

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 434 Views

An abstract keyword is used to declare methods abstract methods and abstract classes. Once a method is declared abstract we should not specify body for those. Example public abstract class Sample{ public abstract demo(){ } } Error Sample.java:2: error: invalid method declaration; return type required public abstract demo(){ ^ 1 error And once a class is declared abstract it cannot be instantiated. Example public abstract class Sample{ public abstract void demo(); public static void main(String args[]){ new Sample(); } } Error C:\Sample>javac Sample.java Sample.java:4: error: Sample is abstract; cannot be instantiated new Sample(); ^ 1 error

Read More

Passing data from one report to another in ABAP using SUBMIT \\\\\\\\n

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 373 Views

There doesn't seem to be any error in your syntax. Please verify if you declared the variables correctly. In case they are defined correctly, try the extended syntax check to see the error. The extended check can be done by going to PROGRAM => Check => Extended Syntax Check.

Read More

Rfcabapexception error while querying a number of columns using RFC_READ_TABLE in SAP

Vikyath Ram
Vikyath Ram
Updated on 30-Jul-2019 370 Views

It is not because of a number of columns but the actual total size of the fields you are querying. It should not be more than 512 bytes.  For RFC communication, the types likes DATA or STANDARD table are not supported. So the RFC_READ_TABLE function module has to convert the data into the generic format and the data is transferred as a series of lines. It is the size of these table lines that matter. The size cannot exceed 512 characters.  If the size is greater than 512 characters, the module throws a Rfcabapexception exception with a short dump.  The ...

Read More
Showing 91–96 of 96 articles
« Prev 1 6 7 8 9 10 Next »
Advertisements