Is Null a Keyword in Java

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

639 Views

No, null is not a keyword. Though they seem like keywords null, true and, false are considered as literals in Java.

What is Is-a Relationship in Java

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

1K+ Views

IS-A is a way of saying: This object is a type of that object. Let us see how the extends keyword is used to achieve inheritance.Examplepublic class Animal { } public class Mammal extends Animal { } public class Reptile extends Animal { } public class Dog extends Mammal { }Now, based on the above example, in Object-Oriented terms, the following are true −Animal is the superclass of Mammal class.Animal is the superclass of Reptile class.Mammal and Reptile are subclasses of Animal class.Dog is the subclass of both Mammal and Animal classes.Example Live Democlass Animal { } class Mammal extends Animal ... Read More

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

207 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

281 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

171 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

366 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

464 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

Advertisements