Return an Array from a Method in Java

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

6K+ Views

We can return an array in Java from a method in Java. Here we have a method createArray() from which we create an array dynamically by taking values from the user and return the created array.Example Live Demoimport java.util.Arrays; import java.util.Scanner; public class ReturningAnArray {    public int[] createArray() {       Scanner sc = new Scanner(System.in);       System.out.println("Enter the size of the array that is to be created:: ");       int size = sc.nextInt();       int[] myArray = new int[size];       System.out.println("Enter the elements of the array ::");       for(int i=0; i

What Does the Method clone Do in Java

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

197 Views

The clone() method of the java.util.ArrayList class returns a shallow copy of this ArrayList instance(i.e. the elements themselves are not copied). Example import java.util.ArrayList; public class ArrayListDemo { public static void main(String args[]) { ArrayList arrlist1 = new ArrayList(); arrlist1.add(new StringBuilder("Learning-")); ArrayList arrlist2 = (ArrayList) arrlist1.clone(); StringBuilder strbuilder = arrlist1.get(0); strbuilder.append("list1, list2-both pointing to the same StringBuilder"); ... Read More

What is Core JavaScript Language

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

3K+ Views

Core JavaScript is the basis of the JavaScript language. JavaScript is a dynamic computer programming language. It is lightweight and most commonly used as apart from web pages, whose implementations allow a client-side script to interact with the user and make dynamic pages.The JavaScript language has the following components: Core JavaScript:Core JavaScript is the basic of the JavaScript language supports both the client and server side.Client-side javascript (CSJS)The client-side JavaScript has core JavaScript elements.  For functioning, it also has properties and methods, which helps developers.Server-side JavaScript (SSJS) Server-side JavaScript, as the name suggests runs on server-side. The core is part of client-side ... Read More

Add Items to an Array in Java Dynamically

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

11K+ Views

Since the size of an array is fixed you cannot add elements to it dynamically. But, if you still want to do it then, Convert the array to ArrayList object.Add the required element to the array list.Convert the Array list to array.Exampleimport java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class AddingItemsDynamically {    public static void main(String args[]) {       Scanner sc = new Scanner(System.in);       System.out.println("Enter the size of the array :: ");       int size = sc.nextInt();       String myArray[] = new String[size];       System.out.println("Enter elements of the array ... Read More

Create a Generic Array in Java

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

267 Views

No, we can’t create generic arrays in java.

Apply Filtering on Model to Fetch Filtered Data in ABAP

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

166 Views

I think a simple change can sort the problem out over here. Just replace the read call with an object notation rather than the current one which is based on position.

Connecting SAP SOAP WebService with Android Application

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

357 Views

You are passing parameter in URL like this: http://XXX.com/xyz/api/sap-client=100&sap-user=username&sap-password=xxxxx"Instead of this, you should pass parameter like this: request.addProperty("sap-client", "100"); request.addProperty("sap-user", "*"); request.addProperty("sap-password", "*");

OData or Java Services for SAP UI5 Application

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

456 Views

Before I make any proposal, I am assuming that you understand both oData and REST very well. REST is a well-known and accomplished architecture style whereas oData is a protocol for communication.OData resides on top of Atompub protocol which in turn is based on REST so overall oData seems to follow REST path only and it is implemented in a similar manner.The advantage that you get with oData is that it saves a lot of effort and time in handling client side either by writing Javascript code or something else. I agree that the support in JAVA for oData will ... Read More

Automate SAP Transactions Using SAP GUI

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

907 Views

You can use SAP GUI. It has built-in tool which can record and playback activity that can be utilized for automation and automated jobs. In case, the values or inputs are not changing then you can use the same script on each occasion.It lies within the main menu of the GUI window, within Customize layout -> Script recording and playback.

Moving to SAP BOXI 4.0 from BO XIR2

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

159 Views

This could be cause of usage of different versions of cryptocme2.dllThis is location of CA's file: C:\Program Files\CA\SC\ETPKI\lib\cryptocme2.dll [Additional Info: File Version: Not Available, Timestamp: 2/29/2012 9:43 PM, size 3, 188 KB] Location of SAP's file : D:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\cryptocme2.dll [ Additional Info: File Version 3.0.0.0 , TimeStamp: 2/25/2011 6:55 PM, size: 1704 KB]To fix this issue: you need to rename dll C:\Program Files\CA\SC\ETPKI\lib\cryptocme2.dll to cryptocme2_ca.dllNext is to copy D:\Program Files\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\win32_x86\cryptocme2.dll to C:\Program Files\CA\SC\ETPKI\lib\Next is to uninstall BO XI 4.0 SDK via Control Panel.You have to restart the Box and stop ... Read More

Advertisements