What is Meant by Java Being Write Once, Run Anywhere Language

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

419 Views

Unlike many other programming languages including C and C++, when Java is compiled, it is not compiled into platform specific machine, rather into platform independent byte code. This byte code is distributed over the web and interpreted by the Virtual Machine (JVM) on whichever platform it is being run on. Thus when you write a piece of Java code in a particular platform and generated an executable code .class file. You can execute/run this class file on any system the only condition is that the target system should have JVM (JRE) installed in it. In Short, If you have a ... Read More

When to Use Vararg Methods in Java

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

229 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 public class Main { static int sumvarargs(int... intArrays) { int sum, i; sum = 0; for(i = 0; i< intArrays.length; i++) { ... Read More

Is a Catch Block Necessary After a Try Block in Java?

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

698 Views

Not necessarily catch, a try must be followed by either catch or finally block. Example import java.io.File; public class Test{ public static void main(String args[]){ System.out.println("Hello"); try{ File file = new File("data"); } } } Output C:\Sample>Javac Test.java Test.java:5: error: 'try' without 'catch', 'finally' or resource declarations try{ ^ 1 error

What are Checked Exceptions in Java

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

945 Views

A checked exception is an exception that occurs at the time of compilation, these are also called as compile time exceptions. These exceptions cannot simply be ignored at the time of compilation; the programmer should take care of (handle) these exceptions. if you use FileReader class in your program to read data from a file, if the file specified in its constructor doesn't exist, then a FileNotFoundException occurs, and the compiler prompts the programmer to handle the exception. Example import java.io.File; import java.io.FileReader; public class FilenotFound_Demo { public static void main(String args[]) { ... Read More

RFC or BAPI for Displaying Change Documents in SAP

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

576 Views

You need to set up a workflow engine and then customize event generation. Next is to write down a Java service to connect to SAP system using Java Connector and then register a RFC server. For this, you have to follow steps:Navigate to Transaction SM59 -> Expand TCP/IP connections directory and click on Create (F8).In the RFC destination field, enter the name of the RFC destination system. Next is to set the connection type to T (Start an external program through TCP/IP).Next is to provide a Function Module handler that can be called using tRFC from SAP system -> Next ... Read More

Pass Import Parameter Values Using SAP RFC Class

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

548 Views

Check the below link to know detail about SAPRFC class. https://github.com/sensational/php-saprfc/tree/php7https://github.com/piersharding/php-sapnwrfc

What is a JAR File?

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

3K+ Views

A java archive file is a file format/ archiving tool which contains all the components of an executable Java application. All the predefined libraries are available in this format. To include any of these (other than rt.jar) in to your project you need to set the class path for this particular JAR file. You can create a JAR file using the command line options or using any IDE’s. Creating a Jar file You can create a Jar file using the jar command as shown below. jar cf jar-file input-file(s) Let us consider an example, create a Sample Java ... Read More

What are Native Methods in Java and Where are They Used

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

2K+ Views

A native method in Java is a method whose implementation is written in other languages such as c and c++. The ‘native’ keyword is used before a method to indicate that it is implemented in other language.

Generate SAP ABAP Code from XML

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

880 Views

Yes, this is feasible. You can create simple transformation for XML in ABAP. You can also use cl_proxy_xml_transform to transform data between XML and ABAP. Let us say that you have created ABAP proxy using T-Code: SPROXY or it is generated via WebService generation utility, you can use utility class “cl_proxy_xml_transform” to convert data of the ABAP to XML format or also from XML → ABAP.

Difference Between a Java Method and a Native Method

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

645 Views

A native method is the one whose method implementation is done in other languages like c++ and Java. These programs are linked to Java using JNI or JNA interfaces. The difference between normal method and native method is That the native method declaration contains native keyword and, the implementation of the method will be other programming language. Example Tester.java public class Tester { public native int getValue(int i); public static void main(String[] args) { System.loadLibrary("Tester"); System.out.println(new Tester().getValue(2)); ... Read More

Advertisements