SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII. N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur

Size: px
Start display at page:

Download "SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII. N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur"

Transcription

1 SUB CODE:IT0407 SUB NAME:INTEGRATIVE PROGRAMMING & TECHNOLOGIES SEM : VII N.J.Subashini Assistant Professor,(Sr. G) SRM University, Kattankulathur 1

2 UNIT I 2

3 UNIT 1 LANGUAGE INTEROPERABILITY IN JAVA 9 Using non-java code: The Java Native Interface - Calling a native method -Implementing your DLL - Accessing JNI functions - Passing and using Java objects - JNI and Java exceptions-jni and threading 3

4 Introduction 4

5 to access the non java codes different vendors provides different solutions Java 1.1 has the Java Native Interface (JNI) Netscape has proposed its Java Runtime Interface Microsoft offers J/Direct, Raw Native Interface (RNI), and Java/COM integration. Another Solution is CORBA((Common Object Request Broker Architecture), an integration technology developed by the OMG (Object Management Group) interoperable with objects no language specific provides common communication bus and services called ORB(Object Request Broker) 5

6 Java Native Interface 6

7 JNI is a fairly rich programming interface that allow to call native methods from a Java application. It was added in Java 1.1, maintaining a certain degree of compatibility with its Java 1.0 equivalent, the native method interface (NMI). NMI has design characteristics that make it unsuitable for adoption in all virtual machines. For this reason, future versions of the language might no longer support NMI. 7

8 JNI is designed to interface with native methods written only in C or C++. Using JNI, native methods can: Create, inspect, and update Java objects (including arrays and Strings) Call Java methods Catch and throw exceptions Load classes and obtain class information Perform runtime type checking Thus, virtually everything which can be done with classes and objects in ordinary Java can also be done in native methods. 8

9 Steps for creating a JNI Program:- 1. Create a java file with a native methods 2. Create header file for the java file 3. Create C file using the header file generated for the java file, which have the native method structure 4. Create.dll file 5. Execute the program 9

10 10

11 Create a java file with a native methods:- Create a new project called as JniDemo, don t remove the check boxes in it a project with a subpackage called jnidemo and a class called Main will be opened. now include the following code in it 11

12 package jnidemo; public class Main { private native static void nativeprint(); public native static int intmethod(int n); public static void main(string[] args) { nativeprint(); System.out.println("Sum=="+ intmethod(10)); } } Compile and build 12

13 Create header file for the java file To create the.h file for the java file use the following command E:\Programs\Jnidemo\src\jnidemo>"C:\Program Files\Java\jdk1.6.0_07\bin\javah.exe" -o HelloWorldNaive.h -jni -classpath..\..\build\classes jnidemo.main A HelloWorldNative.h C header file is generated. It is required to provide correct function declaration for the native implementation of the nativeprint() method. 13

14 Header file generated will contain the native method definition that to be implemented in C/C++ code Copy the definitions of the following format JNIEXPORT void JNICALL Java_ajnidemo_Main_nativePrint (JNIEnv *, jclass); JNIEXPORT jint JNICALL Java_ajnidemo_Main_intMethod (JNIEnv *, jclass, jint); JNIEXPORT and JNICALL are macros that expand to match platform-specific directives, it is also used to specify the calling and linkage convention of both JNI functions and native method implementations. 14

15 The first argument, of type JNIEnv, contains all the hooks that allow to call back into the JVM. The second argument has a different meaning depending on the type of method. For non-static methods (also called instance methods), the second argument is the equivalent of the this pointer in C++ and similar to this in Java: it s a reference to the object that called the native method. For static methods, it s a reference to the Class object where the method is implemented. The remaining arguments represent the Java objects passed into the native method call. Primitives are also passed in this way, but they come in by value. 15

16 The JNIEnv argument JNI functions are those that the programmer uses to interact with the JVM from inside a native method. Every JNI native method receives a special argument as its first parameter: the JNIEnv argument, which is a pointer to a special JNI data structure of type JNIEnv_. One element of the JNI data structure is a pointer to an array generated by the JVM; each element of this array is a pointer to a JNI function. The JNI functions can be called from the native method by dereferencing these pointers Every JVM provides its own implementation of the JNI functions 16

17 17

18 JNI Primitive Types 18

19 JNI Reference Types 19

20 Through the JNIEnv argument, the programmer has access to a large set of functions. These functions can be grouped into the following categories: Obtaining version information Performing class and object operations Handling global and local references to Java objects Accessing instance fields and static fields Calling instance methods and static methods Performing string and array operations Generating and handling Java exceptions 20

21 In the jni.h header file, we can see that inside the #ifdef cplusplus preprocessor conditional, the JNIEnv_ structure is defined as a class when compiled by a C++ compiler. This class contains a number of inline functions that let you access the JNI functions with an easy and familiar syntax Example: In C (*jenv) ReleaseStringUTFChars(jEnv,jMsg, msg); In C++ jenv ReleaseStringUTFChars(jMsg, msg); 21

22 About Cygwin: Cygwin is: a collection of tools which provide a Linux look and feel environment for Windows. a DLL (cygwin1.dll) which acts as a Linux API layer providing substantial Linux API functionality. Cygwin is not: a way to run native Linux apps on Windows. You must rebuild your application from source if you want it to run on Windows. a way to magically make native Windows apps aware of UNIX functionality like signals, ptys, etc. Again, you need to build your apps from source if you want to take advantage of Cygwin functionality. 22

23 Before creating the C file just download and install CYGWIN to enable C/C++ package in netbeans IDE. Steps for doing it 1. Download and run the Cygwin installer from 2. At the Choose Installation Type page, select Install From Internet, and click Next. 3. At the Choose Installation Directory page, define the settings appropriate for the system, then click Next. 4. At the Select Local Package Directory page, define the directory which Cygwin installer will use as its cache directory, and click Next. 23

24 5. At the Select Connection Type page, choose the type of Internet connection you have, and click Next. 6. At the Choose Download Site(s) page, select a mirror which is closest to your location, and click Next. 7. At the Select Packages page, select at least these packages: gcc-core, gcc-g++, gdb, and make. 24

25 Create a C program Open a C/C++ application and a C Main file in to it (JniCApp project name and MainC file). press Ctrl 2 and select the Jnidemo project and select src. You can find the.h file in it. Drag and drop it the JniCApp project which will be included in the nbproject folder remove the main method in it and paste the methods that is been copied from the header file include 2 header files in the c file 1. #include HelloWorldNative.h 2. #include <jni.h> Now give the method body for the methods pasted from header file as follows 25

26 JNIEXPORT void JNICALL Java_ajnidemo_Main_nativePrint (JNIEnv *env, jobject obj) { printf("\nhello World Native "); } JNIEXPORT jint JNICALL Java_ajnidemo_Main_intMethod (JNIEnv *env, jobject obj, jint num) { return num+num; } Save, Right click and build the project 26

27 To enable jni.h header file do the following step 1. Right-click the project node and choose Properties from the context menu. 2. Select C Complier from categories click include directories from it I the next dialog box click Add button, from the select directory dialog select the following paths and click ok C:/Program Files/Java/jdk1.6.0_07/include C:/Program Files/Java/jdk1.6.0_07/include/win32 3. Now click the Additional option and type the following -mno-cygwin -Wl,--add-stdcall-alias -shared -m32 4. Select Linker from categories and type the following in output dist/helloworldnative.dll which will create the.dll file in the dist folder of JniCApp project 27

28 The -mno-cygwin option, enables building DLLs that have no dependencies on Cygwin own libraries and thus can be executed on machines which do not have Cygwin installed. The -Wl,--add-stdcall-alias passes the --add-stdcall-alias option to the linker; without it, the resulting application would fail with the UnsatisfiedLinkError. The -shared option tells the compiler to generate a DLL ( not an executable file). -m32 tells the compiler to create a 32-bit binary. On 64-bit systems the compiled binaries are 64-bit by default,which causes a lot of problems with 32-bit JDKs. 28

29 Now include the.dll file in the java file as shown below static { System.load ("E:\\Programs\\AJNICApp\\dist\\HelloWorldNative.dll"); } Execute your java file 29

30 Accessing Java Strings:- Java Strings are in Unicode format if the user want to pass it to a non-unicode function (printf( ), for example), user must first convert it into ASCII characters with the JNI function GetStringUTFChars( ). This function takes a Java String and converts it to UTF-8 characters. const char *str = (*env)->getstringutfchars(env,string,0) to convert back to unicode format string (*env)->releasestringutfchars(env,string,str); 30

31 Passing and using Java objects 31

32 In the above program int value is passed as an argument. In Native methods we can also pass java object as an arguments follows class MyJavaClass { public void divbytwo() { avalue /= 2.0f; System.out.printn(aValue); } public flaot avalue; } 32

33 public class UseObjects { public static void main(string [] args) { UseObjects app = new UseObjects(); MyJavaClass anobj = new MyJavaClass(); anobj.avalue = 2; app.changeobject(anobj); System.out.println("Java: " + anobj.avalue); } private native void changeobject(myjavaclass obj); static { System.loadLibrary("UseObjImpl"); } } 33

34 JNI Method is of the format as follows:- JNIEXPORT void JNICALL Java_UseObjects_changeObject ( JNIEnv * env, jobject jthis, jobject obj) { //body } 34

35 JNI and Java exceptions:- With JNI, Java exceptions can be thrown, caught, printed, and rethrown just as they are inside a Java program. But it s up to the programmer to call dedicated JNI functions to deal with exceptions. Here are the JNI functions for exception handling: 1. Throw( ) Throws an existing exception object. Used in native methods to rethrow an exception. 2. ThrowNew( ) Generates a new exception object and throws it. 3. ExceptionOccurred( ) Determines if an exception was thrown and not yet cleared. 35

36 4. ExceptionDescribe( ) Prints an exception and the stack trace. 5. ExceptionClear( ) Clears a pending exception. 6. FatalError( ) Raises a fatal error. Does not return 36

37 Example:- JAVA CODE:- class CatchThrow { private native void doit() throws IllegalArgumentException; private void callback() throws NullPointerException { throw new NullPointerException("CatchThrow.callback"); } public static void main(string args[]) { CatchThrow c = new CatchThrow(); try { c.doit(); c.callback(); } catch (Exception e) { System.out.println("In Java:\n\t" + e); } } static { System.loadLibrary("CatchThrow"); } } 37

38 PART OF C CODE:- JNIEXPORT void JNICALL Java_CatchThrow_doit(JNIEnv *env, jobject obj) { --- exc = (*env)->exceptionoccurred(env); if (exc) { --- (*env)->exceptiondescribe(env); (*env)->exceptionclear(env); --- } (*env)->thrownew(env, newexccls, "thrown from C code"); } 38

39 JNI and threading 39

40 Synchronization 40

41 When two or more threads need access to a shared resource, they need some way to ensure that the resource will be used by only one thread at a time. The process by which this is achieved is called synchronization. Java provides unique, language-level support for it. Key to synchronization is the concept of the monitor (also called a semaphore). A monitor is an object that is used as a mutually exclusive lock, or mutex. 41

42 Only one thread can own a monitor at a given time. When a thread acquires a lock, it is said to have entered the monitor. All other threads attempting to enter the locked monitor will be suspended until the first thread exits the monitor. These other threads are said to be waiting for the monitor. A thread that owns a monitor can reenter the same monitor if it so desires. synchronization can be done in two ways using synchronized keyword 1. Applying for a method (synchronized Method) 2. Applying for a Statement (synchronized Block) 42

43 43

44 Using Synchronized Methods 44

45 Example: Without Using Synchronization Here is the output produced by this program: Hello[Synchronized[World] ] ] 45

46 Example: With Synchronization OUTPUT: [Hello] [World] [Synchronized] 46

47 The synchronized Statement 47

48 Example: With Synchronization statement Output: [Hello] [World] [Synchronized] 48

49 JNI and Threads The Java virtual machine supports multiple threads of control concurrently executing in the same address space. This concurrency introduces a degree of complexity that user do not have in a singlethreaded environment. Multiple threads may access the same objects, the same file descriptors, the same shared resources--at the same time. Constraints There are certain constraints that user must keep in mind when writing native methods that are to run in a multithreaded environment. By understanding and programming within these constraints, native methods will execute safely no matter how many threads simultaneously execute a given native method. 49

50 For example: A JNIEnv pointer is only valid in the thread associated with it, user should not pass this pointer from one thread to another, or cache and use it in multiple threads. The JVM passes a native method the same JNIEnv pointer in consecutive invocations from the same thread, but passes different JNIEnv pointers when invoking that native method from different threads. Local references are valid only in the thread that created them. User should not pass local references from one thread to another. User should always convert local references to global references whenever there is a possibility that multiple threads may use the same reference. 50

51 Monitor Entry and Exit Monitors are the primitive synchronization mechanism on the Java platform. Each object can be dynamically associated with a monitor. The JNI allows user to synchronize using these monitors, thus implementing the functionality equivalent to a synchronized block in the Java programming language: synchronized (obj) {... // synchronized block } 51

52 The Java virtual machine guarantees that a thread acquires the monitor associated with the object obj before it executes any statements in the block. This ensures that there can be at most one thread that holds the monitor and executes inside the synchronized block at any given time. A thread blocks when it waits for another thread to exit a monitor. Native code can use JNI functions to perform equivalent synchronization on JNI references. User can use the MonitorEnter function to enter the monitor and the MonitorExit function to exit the monitor: 52

53 if ((*env)->monitorenter(env, obj)!= JNI_OK) {... /* error handling */ }... /* synchronized block */ if ((*env)->monitorexit(env, obj)!= JNI_OK){... /* error handling */ }; 53

54 Executing the code above, a thread must first enter the monitor associated with obj before executing any code inside the synchronized block. The Monitor-Enter operation takes a jobject as an argument and blocks if another thread has already entered the monitor associated with the jobject. Calling MonitorExit when the current thread does not own the monitor results in an error and causes an IllegalMonitorStateException to be raised. The above code contains a matched pair of MonitorEnter and MonitorExit calls, yet user still need to check for possible errors. Monitor operations may fail if, for example, the underlying thread implementation cannot allocate the resources necessary to perform the monitor operation. 54

55 MonitorEnter and MonitorExit work on jclass, jstring, and jarray types, which are special kinds of jobject references. Remember to match a MonitorEnter call with the appropriate number of MonitorExit calls, especially in code that handles errors and exceptions: if ((*env)->monitorenter(env, obj)!= JNI_OK)...;... if ((*env)->exceptionoccurred(env)) {... /* exception handling */ /* remember to call MonitorExit here */ if ((*env)->monitorexit(env, obj)!= JNI_OK)...; }... /* Normal execution path. if ((*env)->monitorexit(env, obj)!= JNI_OK)...; 55

56 Failure to call MonitorExit will most likely lead to deadlocks. By comparing the above C code segment with the code segment at the beginning of this section, user can appreciate how much easier it is to program with the Java programming language than with the JNI. Thus, it is preferable to express synchronization constructs in the Java programming language. If, for example, a static native method needs to enter the monitor associated with its defining class, we should define a static synchronized native method as opposed to performing JNI-level monitor synchronization in native code. 56

57 Monitor Wait and Notify The Java API contains several other methods that are useful for thread synchronization. They are Object.wait, Object.notify, and Object.notifyAll. No JNI functions are supplied that correspond directly to these methods because monitor wait and notify operations are not as performance critical as monitor enter and exit operations. Native code may instead use the JNI method call mechanism to invoke the corresponding methods in the Java API: 57

58 /* precomputed method IDs */ static jmethodid MID_Object_wait; static jmethodid MID_Object_notify; static jmethodid MID_Object_notifyAll; void JNU_MonitorWait(JNIEnv *env, jobject object, jlong timeout){ (*env)->callvoidmethod(env, object, MID_Object_wait, timeout); } Void JNU_MonitorNotify(JNIEnv *env, jobject object){ (*env)->callvoidmethod(env, object, MID_Object_notify); } Void JNU_MonitorNotifyAll(JNIEnv *env, jobject object){ (*env)->callvoidmethod(env, object, MID_Object_notifyAll); } 58

59 User assume that the method IDs for Object.wait, Object.notify, and Object.notifyAll have been calculated elsewhere and are cached in the global variables. Like in the Java programming language, user can call the above monitor-related functions only when holding the monitor associated with the jobject argument. 59

60 Obtaining a JNIEnv Pointer in Arbitrary Contexts explained earlier that a JNIEnv pointer is only valid in its associated thread. This is generally not a problem for native methods because they receive the JNIEnv pointer from the virtual machine as the first argument. Occasionally, however, it may be necessary for a piece of native code not called directly from the virtual machine to obtain the JNIEnv interface pointer that belongs to the current thread. For example, the piece of native code may belong to a "callback" function called by the operating system, in which case the JNIEnv pointer will probably not be available as an argument. 60

61 User can obtain the JNIEnv pointer for the current thread by calling the AttachCurrentThread function of the invocation interface: JavaVM *jvm; /* already set */ f() { JNIEnv *env; (*jvm)->attachcurrentthread(jvm, (void **)&env, NULL);... /* use env */ } When the current thread is already attached to the virtual machine, Attach-Current- Thread returns the JNIEnv interface pointer that belongs to the current thread. 61

62 There are many ways to obtain the JavaVM pointer: by recording it when the virtual machine is created, by querying for the created virtual machines using JNI_GetCreatedJavaVMs, by calling the JNI function GetJavaVMinside a regular native method, or by defining a JNI_OnLoad handler. Unlike the JNIEnv pointer, the JavaVM pointer remains valid across multiple threads so it can be cached in a global variable. Java 2 SDK release 1.2 provides a new invocation interface function GetEnv so that you can check whether the current thread is attached to the virtual machine, and, if so, to return the JNIEnv pointer that belongs to the current thread. GetEnv and AttachCurrentThread are functionally equivalent if the current thread is already attached to the virtual machine. 62

Lecture 5 - NDK Integration (JNI)

Lecture 5 - NDK Integration (JNI) Lecture 5 - NDK Integration (JNI) This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/

More information

JAVA Native Interface

JAVA Native Interface CSC 308 2.0 System Development with Java JAVA Native Interface Department of Statistics and Computer Science Java Native Interface Is a programming framework JNI functions written in a language other than

More information

Java/JMDL communication with MDL applications

Java/JMDL communication with MDL applications m with MDL applications By Stanislav Sumbera [Editor Note: The arrival of MicroStation V8 and its support for Microsoft Visual Basic for Applications opens an entirely new set of duallanguage m issues

More information

NDK Integration (JNI)

NDK Integration (JNI) NDK Integration (JNI) Lecture 6 Operating Systems Practical 9 November 2016 This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit

More information

LEVERAGING EXISTING PLASMA SIMULATION CODES. Anna Malinova, Vasil Yordanov, Jan van Dijk

LEVERAGING EXISTING PLASMA SIMULATION CODES. Anna Malinova, Vasil Yordanov, Jan van Dijk 136 LEVERAGING EXISTING PLASMA SIMULATION CODES Anna Malinova, Vasil Yordanov, Jan van Dijk Abstract: This paper describes the process of wrapping existing scientific codes in the domain of plasma physics

More information

Lecture 6 - NDK Integration (JNI)

Lecture 6 - NDK Integration (JNI) Lecture 6 - NDK Integration (JNI) This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit http://creativecommons.org/licenses/by/4.0/

More information

We can also throw Java exceptions in the native code.

We can also throw Java exceptions in the native code. 4. 5. 6. 7. Java arrays are handled by JNI as reference types. We have two types of arrays: primitive and object arrays. They are treated differently by JNI. Primitive arrays contain primitive data types

More information

Calling C Function from the Java Code Calling Java Method from C/C++ Code

Calling C Function from the Java Code Calling Java Method from C/C++ Code Java Native Interface: JNI Calling C Function from the Java Code Calling Java Method from C/C++ Code Calling C Functions From Java Print Hello Native World HelloNativeTest (Java) HelloNative.c HelloNative.h

More information

Java Native Interface. Diego Rodrigo Cabral Silva

Java Native Interface. Diego Rodrigo Cabral Silva Java Native Interface Diego Rodrigo Cabral Silva Overview The JNI allows Java code that runs within a Java Virtual Machine (VM) to operate with applications and libraries written in other languages, such

More information

Invoking Native Applications from Java

Invoking Native Applications from Java 2012 Marty Hall Invoking Native Applications from Java Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/java.html Customized Java EE Training: http://courses.coreservlets.com/

More information

Android NDK. Federico Menozzi & Srihari Pratapa

Android NDK. Federico Menozzi & Srihari Pratapa Android NDK Federico Menozzi & Srihari Pratapa Resources C++ CMake https://cmake.org/cmake-tutorial/ http://mathnathan.com/2010/07/getting-started-with-cmake/ NDK http://www.cplusplus.com/doc/tutorial/

More information

Java TM Native Methods. Rex Jaeschke

Java TM Native Methods. Rex Jaeschke Java TM Native Methods Rex Jaeschke Java Native Methods 1999, 2007, 2009 Rex Jaeschke. All rights reserved. Edition: 2.0 (matches JDK1.6/Java 2) All rights reserved. No part of this publication may be

More information

Porting Guide - Moving Java applications to 64-bit systems. 64-bit Java - general considerations

Porting Guide - Moving Java applications to 64-bit systems. 64-bit Java - general considerations Porting Guide - Moving Java applications to 64-bit systems IBM has produced versions of the Java TM Developer Kit and Java Runtime Environment that run in true 64-bit mode on 64-bit systems including IBM

More information

Study on Programming by Combining Java with C++ Based on JNI

Study on Programming by Combining Java with C++ Based on JNI doi: 10.14355/spr.2016.05.003 Study on Programming by Combining Java with C++ Based on JNI Tan Qingquan 1, Luo Huachun* 2, Jiang Lianyan 3, Bo Tao 4, Liu Qun 5, Liu Bo 6 Earthquake Administration of Beijing

More information

Inlining Java Native Calls at Runtime

Inlining Java Native Calls at Runtime Inlining Java Native Calls at Runtime (CASCON 2005 4 th Workshop on Compiler Driven Performance) Levon Stepanian, Angela Demke Brown Computer Systems Group Department of Computer Science, University of

More information

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS

AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS AP COMPUTER SCIENCE JAVA CONCEPTS IV: RESERVED WORDS PAUL L. BAILEY Abstract. This documents amalgamates various descriptions found on the internet, mostly from Oracle or Wikipedia. Very little of this

More information

Le L c e t c ur u e e 5 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Exception Handling

Le L c e t c ur u e e 5 To T p o i p c i s c t o o b e b e co c v o e v r e ed e Exception Handling Course Name: Advanced Java Lecture 5 Topics to be covered Exception Handling Exception HandlingHandlingIntroduction An exception is an abnormal condition that arises in a code sequence at run time A Java

More information

Virtual Machine Design

Virtual Machine Design Virtual Machine Design Lecture 4: Multithreading and Synchronization Antero Taivalsaari September 2003 Session #2026: J2MEPlatform, Connected Limited Device Configuration (CLDC) Lecture Goals Give an overview

More information

Selected Java Topics

Selected Java Topics Selected Java Topics Introduction Basic Types, Objects and Pointers Modifiers Abstract Classes and Interfaces Exceptions and Runtime Exceptions Static Variables and Static Methods Type Safe Constants Swings

More information

CS 3305 Intro to Threads. Lecture 6

CS 3305 Intro to Threads. Lecture 6 CS 3305 Intro to Threads Lecture 6 Introduction Multiple applications run concurrently! This means that there are multiple processes running on a computer Introduction Applications often need to perform

More information

Concurrent Programming using Threads

Concurrent Programming using Threads Concurrent Programming using Threads Threads are a control mechanism that enable you to write concurrent programs. You can think of a thread in an object-oriented language as a special kind of system object

More information

Exception Namespaces C Interoperability Templates. More C++ David Chisnall. March 17, 2011

Exception Namespaces C Interoperability Templates. More C++ David Chisnall. March 17, 2011 More C++ David Chisnall March 17, 2011 Exceptions A more fashionable goto Provides a second way of sending an error condition up the stack until it can be handled Lets intervening stack frames ignore errors

More information

A Politically Correct Use for Native Methods Loading Database Tables

A Politically Correct Use for Native Methods Loading Database Tables A Politically Correct Use for Native Methods Loading Database Tables James W. Cooper You probably know that you can write Java programs to connect to native code. I always assumed that this feature was

More information

1 Shyam sir JAVA Notes

1 Shyam sir JAVA Notes 1 Shyam sir JAVA Notes 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write

More information

Introduction to Java

Introduction to Java Introduction to Java Module 1: Getting started, Java Basics 22/01/2010 Prepared by Chris Panayiotou for EPL 233 1 Lab Objectives o Objective: Learn how to write, compile and execute HelloWorld.java Learn

More information

Chapter 13 Exception Handling

Chapter 13 Exception Handling Chapter 13 Exception Handling 1 Motivations When a program runs into a runtime error, the program terminates abnormally. How can you handle the runtime error so that the program can continue to run or

More information

NDK OVERVIEW OF THE ANDROID NATIVE DEVELOPMENT KIT

NDK OVERVIEW OF THE ANDROID NATIVE DEVELOPMENT KIT ANDROID NDK OVERVIEW OF THE ANDROID NATIVE DEVELOPMENT KIT Peter R. Egli INDIGOO.COM 1/16 Contents 1. What you can do with NDK 2. When to use native code 3. Stable APIs to use / available libraries 4.

More information

TinyVM: User's Guide

TinyVM: User's Guide TinyVM (Java for Lego RCX) - User's Guide Page 1 of 3 TinyVM: User's Guide The information in this guide may only apply to the latest version of TinyVM Unix Edition. For the Cross-Platform Edition, please

More information

User Space Multithreading. Computer Science, University of Warwick

User Space Multithreading. Computer Science, University of Warwick User Space Multithreading 1 Threads Thread short for thread of execution/control B efore create Global During create Global Data Data Executing Code Code Stack Stack Stack A fter create Global Data Executing

More information

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1 Agenda CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Summer 2004 Java virtual machine architecture.class files Class loading Execution engines Interpreters & JITs various strategies

More information

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception Ariel Shamir 1 Run-time Errors Sometimes when the computer

More information

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit

Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multit Threads Multitasking Multitasking allows several activities to occur concurrently on the computer. A distinction is usually made between: Process-based multitasking Thread-based multitasking Multitasking

More information

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong:

Exception Handling. Run-time Errors. Methods Failure. Sometimes when the computer tries to execute a statement something goes wrong: Exception Handling Run-time errors The exception concept Throwing exceptions Handling exceptions Declaring exceptions Creating your own exception 22 November 2007 Ariel Shamir 1 Run-time Errors Sometimes

More information

CMSC 132: Object-Oriented Programming II

CMSC 132: Object-Oriented Programming II CMSC 132: Object-Oriented Programming II Synchronization in Java Department of Computer Science University of Maryland, College Park Multithreading Overview Motivation & background Threads Creating Java

More information

Writing a Client Application for Genesis II Contributors: Chris Sosa Last Modified: 06/05/2007

Writing a Client Application for Genesis II Contributors: Chris Sosa Last Modified: 06/05/2007 Writing a Client Application for Genesis II Contributors: Chris Sosa (sosa@virginia.edu) Last Modified: 06/05/2007 Introduction The purpose of this White Paper is to discuss the use of the University of

More information

SmartHeap for Multi-Core

SmartHeap for Multi-Core SmartHeap for Multi-Core Getting Started and Platform Guide for Linux Version 11.2 SmartHeap and HeapAgent are trademarks of Compuware Corporation. All other trademarks are the property of their respective

More information

JOURNAL OF OBJECT TECHNOLOGY

JOURNAL OF OBJECT TECHNOLOGY JOURNAL OF OBJECT TECHNOLOGY Online at www.jot.fm. Published by ETH Zurich, Chair of Software Engineering JOT, 2002 Vol. 1, no. 4, September-October 2002 Easing the Transition from C++ to Java (Part 2)

More information

Faculty of Computers & Information Computer Science Department

Faculty of Computers & Information Computer Science Department Cairo University Faculty of Computers & Information Computer Science Department Theoretical Part 1. Introduction to Critical Section Problem Critical section is a segment of code, in which the process

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

CSE 230 Intermediate Programming in C and C++ Functions

CSE 230 Intermediate Programming in C and C++ Functions CSE 230 Intermediate Programming in C and C++ Functions Fall 2017 Stony Brook University Instructor: Shebuti Rayana shebuti.rayana@stonybrook.edu http://www3.cs.stonybrook.edu/~cse230/ Concept of Functions

More information

Pointers, Dynamic Data, and Reference Types

Pointers, Dynamic Data, and Reference Types Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation The new operator The delete operator Dynamic Memory Allocation for Arrays 1 C++ Data Types simple

More information

Java Threads and intrinsic locks

Java Threads and intrinsic locks Java Threads and intrinsic locks 1. Java and OOP background fundamentals 1.1. Objects, methods and data One significant advantage of OOP (object oriented programming) is data encapsulation. Each object

More information

By: Abhishek Khare (SVIM - INDORE M.P)

By: Abhishek Khare (SVIM - INDORE M.P) By: Abhishek Khare (SVIM - INDORE M.P) MCA 405 Elective I (A) Java Programming & Technology UNIT-2 Interface,Multithreading,Exception Handling Interfaces : defining an interface, implementing & applying

More information

COMP31212: Concurrency A Review of Java Concurrency. Giles Reger

COMP31212: Concurrency A Review of Java Concurrency. Giles Reger COMP31212: Concurrency A Review of Java Concurrency Giles Reger Outline What are Java Threads? In Java, concurrency is achieved by Threads A Java Thread object is just an object on the heap, like any other

More information

CS 153 Lab4 and 5. Kishore Kumar Pusukuri. Kishore Kumar Pusukuri CS 153 Lab4 and 5

CS 153 Lab4 and 5. Kishore Kumar Pusukuri. Kishore Kumar Pusukuri CS 153 Lab4 and 5 CS 153 Lab4 and 5 Kishore Kumar Pusukuri Outline Introduction A thread is a straightforward concept : a single sequential flow of control. In traditional operating systems, each process has an address

More information

Exceptions. Why Exception Handling?

Exceptions. Why Exception Handling? Exceptions An exception is an object that stores information transmitted outside the normal return sequence. It is propagated back through calling stack until some function catches it. If no calling function

More information

ROS2 for Android, ios and Universal Windows Platform. Esteve Fernandez

ROS2 for Android, ios and Universal Windows Platform. Esteve Fernandez ROS2 for Android, ios and Universal Windows Platform Esteve Fernandez esteve@apache.org Outline Introduction The ROS2 architecture Overview of the changes needed in ROS2 rcljava, rclobjc and rcldotnet

More information

Pace University. Fundamental Concepts of CS121 1

Pace University. Fundamental Concepts of CS121 1 Pace University Fundamental Concepts of CS121 1 Dr. Lixin Tao http://csis.pace.edu/~lixin Computer Science Department Pace University October 12, 2005 This document complements my tutorial Introduction

More information

The Java Native Interface. Programmer s Guide and Specification

The Java Native Interface. Programmer s Guide and Specification The Java Native Interface Programmer s Guide and Specification The Java Native Interface Programmer s Guide and Specification Sheng Liang ADDISON-WESLEY An imprint of Addison Wesley Longman, Inc. Reading,

More information

CSE 374 Programming Concepts & Tools

CSE 374 Programming Concepts & Tools CSE 374 Programming Concepts & Tools Hal Perkins Fall 2017 Lecture 8 C: Miscellanea Control, Declarations, Preprocessor, printf/scanf 1 The story so far The low-level execution model of a process (one

More information

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3

Hello, World! in C. Johann Myrkraverk Oskarsson October 23, The Quintessential Example Program 1. I Printing Text 2. II The Main Function 3 Hello, World! in C Johann Myrkraverk Oskarsson October 23, 2018 Contents 1 The Quintessential Example Program 1 I Printing Text 2 II The Main Function 3 III The Header Files 4 IV Compiling and Running

More information

15CS45 : OBJECT ORIENTED CONCEPTS

15CS45 : OBJECT ORIENTED CONCEPTS 15CS45 : OBJECT ORIENTED CONCEPTS QUESTION BANK: What do you know about Java? What are the supported platforms by Java Programming Language? List any five features of Java? Why is Java Architectural Neutral?

More information

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1

CSE P 501 Compilers. Java Implementation JVMs, JITs &c Hal Perkins Winter /11/ Hal Perkins & UW CSE V-1 CSE P 501 Compilers Java Implementation JVMs, JITs &c Hal Perkins Winter 2008 3/11/2008 2002-08 Hal Perkins & UW CSE V-1 Agenda Java virtual machine architecture.class files Class loading Execution engines

More information

Orbix TS Thread Library Reference

Orbix TS Thread Library Reference Orbix 6.3.9 TS Thread Library Reference Micro Focus The Lawn 22-30 Old Bath Road Newbury, Berkshire RG14 1QN UK http://www.microfocus.com Copyright Micro Focus 2017. All rights reserved. MICRO FOCUS, the

More information

Today. Instance Method Dispatch. Instance Method Dispatch. Instance Method Dispatch 11/29/11. today. last time

Today. Instance Method Dispatch. Instance Method Dispatch. Instance Method Dispatch 11/29/11. today. last time CS2110 Fall 2011 Lecture 25 Java program last time Java compiler Java bytecode (.class files) Compile for platform with JIT Interpret with JVM Under the Hood: The Java Virtual Machine, Part II 1 run native

More information

CS11 Java. Fall Lecture 7

CS11 Java. Fall Lecture 7 CS11 Java Fall 2006-2007 Lecture 7 Today s Topics All about Java Threads Some Lab 7 tips Java Threading Recap A program can use multiple threads to do several things at once A thread can have local (non-shared)

More information

CS 231 Data Structures and Algorithms, Fall 2016

CS 231 Data Structures and Algorithms, Fall 2016 CS 231 Data Structures and Algorithms, Fall 2016 Dr. Bruce A. Maxwell Department of Computer Science Colby College Course Description Focuses on the common structures used to store data and the standard

More information

COE318 Lecture Notes Week 10 (Nov 7, 2011)

COE318 Lecture Notes Week 10 (Nov 7, 2011) COE318 Software Systems Lecture Notes: Week 10 1 of 5 COE318 Lecture Notes Week 10 (Nov 7, 2011) Topics More about exceptions References Head First Java: Chapter 11 (Risky Behavior) The Java Tutorial:

More information

The Java Programming Language

The Java Programming Language The Java Programming Language Slide by John Mitchell (http://www.stanford.edu/class/cs242/slides/) Outline Language Overview History and design goals Classes and Inheritance Object features Encapsulation

More information

Synchronization SPL/2010 SPL/20 1

Synchronization SPL/2010 SPL/20 1 Synchronization 1 Overview synchronization mechanisms in modern RTEs concurrency issues places where synchronization is needed structural ways (design patterns) for exclusive access 2 Overview synchronization

More information

Certified Core Java Developer VS-1036

Certified Core Java Developer VS-1036 VS-1036 1. LANGUAGE FUNDAMENTALS The Java language's programming paradigm is implementation and improvement of Object Oriented Programming (OOP) concepts. The Java language has its own rules, syntax, structure

More information

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads

Chapter 4: Threads. Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Overview Multithreading Models Thread Libraries Threading Issues Operating System Examples Windows XP Threads Linux Threads Chapter 4: Threads Objectives To introduce the notion of a

More information

Concurrency, Thread. Dongkun Shin, SKKU

Concurrency, Thread. Dongkun Shin, SKKU Concurrency, Thread 1 Thread Classic view a single point of execution within a program a single PC where instructions are being fetched from and executed), Multi-threaded program Has more than one point

More information

What is concurrency? Concurrency. What is parallelism? concurrency vs parallelism. Concurrency: (the illusion of) happening at the same time.

What is concurrency? Concurrency. What is parallelism? concurrency vs parallelism. Concurrency: (the illusion of) happening at the same time. What is concurrency? Concurrency Johan Montelius KTH 2017 Concurrency: (the illusion of) happening at the same time. A property of the programing model. Why would we want to do things concurrently? What

More information

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc.

Chapter 1 GETTING STARTED. SYS-ED/ Computer Education Techniques, Inc. Chapter 1 GETTING STARTED SYS-ED/ Computer Education Techniques, Inc. Objectives You will learn: Java platform. Applets and applications. Java programming language: facilities and foundation. Memory management

More information

Concurrency. Johan Montelius KTH

Concurrency. Johan Montelius KTH Concurrency Johan Montelius KTH 2017 1 / 32 What is concurrency? 2 / 32 What is concurrency? Concurrency: (the illusion of) happening at the same time. 2 / 32 What is concurrency? Concurrency: (the illusion

More information

Agenda. Highlight issues with multi threaded programming Introduce thread synchronization primitives Introduce thread safe collections

Agenda. Highlight issues with multi threaded programming Introduce thread synchronization primitives Introduce thread safe collections Thread Safety Agenda Highlight issues with multi threaded programming Introduce thread synchronization primitives Introduce thread safe collections 2 2 Need for Synchronization Creating threads is easy

More information

TS Thread Library Reference. Version 6.2, December 2004

TS Thread Library Reference. Version 6.2, December 2004 TS Thread Library Reference Version 6.2, December 2004 IONA, IONA Technologies, the IONA logo, Orbix, Orbix/E, Orbacus, Artix, Orchestrator, Mobile Orchestrator, Enterprise Integrator, Adaptive Runtime

More information

Java Threads. COMP 585 Noteset #2 1

Java Threads. COMP 585 Noteset #2 1 Java Threads The topic of threads overlaps the boundary between software development and operation systems. Words like process, task, and thread may mean different things depending on the author and the

More information

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23

Contents. Chapter 1 Overview of the JavaScript C Engine...1. Chapter 2 JavaScript API Reference...23 Contents Chapter 1 Overview of the JavaScript C Engine...1 Supported Versions of JavaScript...1 How Do You Use the Engine?...2 How Does the Engine Relate to Applications?...2 Building the Engine...6 What

More information

Need for synchronization: If threads comprise parts of our software systems, then they must communicate.

Need for synchronization: If threads comprise parts of our software systems, then they must communicate. Thread communication and synchronization There are two main aspects to Outline for Lecture 19 multithreaded programming in Java: I. Thread synchronization. thread lifecycle, and thread synchronization.

More information

EMBEDDED SYSTEMS PROGRAMMING Android NDK

EMBEDDED SYSTEMS PROGRAMMING Android NDK EMBEDDED SYSTEMS PROGRAMMING 2014-15 Android NDK WHAT IS THE NDK? The Android NDK is a set of cross-compilers, scripts and libraries that allows to embed native code into Android applications Native code

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

Chapter 1 Getting Started

Chapter 1 Getting Started Chapter 1 Getting Started The C# class Just like all object oriented programming languages, C# supports the concept of a class. A class is a little like a data structure in that it aggregates different

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files ... and systems programming C basic syntax functions arrays structs

More information

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs.

CSC209: Software tools. Unix files and directories permissions utilities/commands Shell programming quoting wild cards files. Compiler vs. CSC209 Review CSC209: Software tools Unix files and directories permissions utilities/commands Shell programming quoting wild cards files... and systems programming C basic syntax functions arrays structs

More information

SSC - Concurrency and Multi-threading Java multithreading programming - Synchronisation (II)

SSC - Concurrency and Multi-threading Java multithreading programming - Synchronisation (II) SSC - Concurrency and Multi-threading Java multithreading programming - Synchronisation (II) Shan He School for Computational Science University of Birmingham Module 06-19321: SSC Outline Outline of Topics

More information

BBM 102 Introduction to Programming II Spring Exceptions

BBM 102 Introduction to Programming II Spring Exceptions BBM 102 Introduction to Programming II Spring 2018 Exceptions 1 Today What is an exception? What is exception handling? Keywords of exception handling try catch finally Throwing exceptions throw Custom

More information

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont.

5/3/2006. Today! HelloWorld in BlueJ. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. HelloWorld in BlueJ, Cont. Today! Build HelloWorld yourself in BlueJ and Eclipse. Look at all the Java keywords. Primitive Types. HelloWorld in BlueJ 1. Find BlueJ in the start menu, but start the Select VM program instead (you

More information

Review: Array Initializer Lists

Review: Array Initializer Lists More on Arrays Review of Arrays of ints, doubles, chars Arrays of objects Command line arguments The ArrayList class Javadoc Review Lecture 8 notes and L&L 7.1 7.2 Reading for this lecture: L&L 7.3 7.7,

More information

Discussion CSE 224. Week 4

Discussion CSE 224. Week 4 Discussion CSE 224 Week 4 Midterm The midterm will cover - 1. Topics discussed in lecture 2. Research papers from the homeworks 3. Textbook readings from Unit 1 and Unit 2 HW 3&4 Clarifications 1. The

More information

WebSphere Message Broker

WebSphere Message Broker WebSphere Message Broker User-defined Extensions Version 6 Release 0 WebSphere Message Broker User-defined Extensions Version 6 Release 0 Note Before using this information and the product it supports,

More information

Chapter 3 Process Description and Control

Chapter 3 Process Description and Control Operating Systems: Internals and Design Principles Chapter 3 Process Description and Control Seventh Edition By William Stallings Process Control Block Structure of Process Images in Virtual Memory How

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

Lecture 1: Overview of Java

Lecture 1: Overview of Java Lecture 1: Overview of Java What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed for easy Web/Internet applications Widespread

More information

The UCSC Java Nanokernel Version 0.2 API

The UCSC Java Nanokernel Version 0.2 API The UCSC Java Nanokernel Version 0.2 API UCSC-CRL-96-28 Bruce R. Montague y Computer Science Department University of California, Santa Cruz brucem@cse.ucsc.edu 9 December 1996 Abstract The Application

More information

CS506 Web Design & Development Final Term Solved MCQs with Reference

CS506 Web Design & Development Final Term Solved MCQs with Reference with Reference I am student in MCS (Virtual University of Pakistan). All the MCQs are solved by me. I followed the Moaaz pattern in Writing and Layout this document. Because many students are familiar

More information

Vector and Free Store (Pointers and Memory Allocation)

Vector and Free Store (Pointers and Memory Allocation) DM560 Introduction to Programming in C++ Vector and Free Store (Pointers and Memory Allocation) Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark [Based on slides

More information

Lectures 5-6: Introduction to C

Lectures 5-6: Introduction to C Lectures 5-6: Introduction to C Motivation: C is both a high and a low-level language Very useful for systems programming Faster than Java This intro assumes knowledge of Java Focus is on differences Most

More information

High Performance Computing Course Notes Shared Memory Parallel Programming

High Performance Computing Course Notes Shared Memory Parallel Programming High Performance Computing Course Notes 2009-2010 2010 Shared Memory Parallel Programming Techniques Multiprocessing User space multithreading Operating system-supported (or kernel) multithreading Distributed

More information

Performance Throughput Utilization of system resources

Performance Throughput Utilization of system resources Concurrency 1. Why concurrent programming?... 2 2. Evolution... 2 3. Definitions... 3 4. Concurrent languages... 5 5. Problems with concurrency... 6 6. Process Interactions... 7 7. Low-level Concurrency

More information

Libgdb. Version 0.3 Oct Thomas Lord

Libgdb. Version 0.3 Oct Thomas Lord Libgdb Version 0.3 Oct 1993 Thomas Lord Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies.

More information

JDB - QUICK GUIDE JDB - INTRODUCTION

JDB - QUICK GUIDE JDB - INTRODUCTION http://www.tutorialspoint.com/jdb/jdb_quick_guide.htm JDB - QUICK GUIDE Copyright tutorialspoint.com JDB - INTRODUCTION Debugging is a technical procedure to find and remove bugs or defects in a program

More information

Introduction to Java. Nihar Ranjan Roy. https://sites.google.com/site/niharranjanroy/

Introduction to Java. Nihar Ranjan Roy. https://sites.google.com/site/niharranjanroy/ Introduction to Java https://sites.google.com/site/niharranjanroy/ 1 The Java Programming Language According to sun Microsystems java is a 1. Simple 2. Object Oriented 3. Distributed 4. Multithreaded 5.

More information

Programs. Function main. C Refresher. CSCI 4061 Introduction to Operating Systems

Programs. Function main. C Refresher. CSCI 4061 Introduction to Operating Systems Programs CSCI 4061 Introduction to Operating Systems C Program Structure Libraries and header files Compiling and building programs Executing and debugging Instructor: Abhishek Chandra Assume familiarity

More information

*Java has included a feature that simplifies the creation of

*Java has included a feature that simplifies the creation of Java has included a feature that simplifies the creation of methods that need to take a variable number of arguments. This feature is called as varargs (short for variable-length arguments). A method that

More information

Exam Number/Code : 1Z Exam Name: Name: Java Standard Edition 6. Demo. Version : Programmer Certified Professional Exam.

Exam Number/Code : 1Z Exam Name: Name: Java Standard Edition 6. Demo. Version : Programmer Certified Professional Exam. Exam Number/Code : 1Z0-851 Exam Name: Name: Java Standard Edition 6 Programmer Certified Professional Exam Version : Demo http://it-shiken.jp/ QUESTION 1 public class Threads2 implements Runnable { public

More information

STRUCTURING OF PROGRAM

STRUCTURING OF PROGRAM Unit III MULTIPLE CHOICE QUESTIONS 1. Which of the following is the functionality of Data Abstraction? (a) Reduce Complexity (c) Parallelism Unit III 3.1 (b) Binds together code and data (d) None of the

More information

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline :: Module Title Duration : Intro to JAVA SE7 and Programming using JAVA SE7 : 9 days Course Description The Java SE 7 Fundamentals course was designed to enable students with little or no programming experience

More information

CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio

CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio CS 5523 Operating Systems: Midterm II - reivew Instructor: Dr. Tongping Liu Department Computer Science The University of Texas at San Antonio Fall 2017 1 Outline Inter-Process Communication (20) Threads

More information