Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ASSIGNMENT: Select ONE of the following languages: C C++ Java For the language t

ID: 3628776 • Letter: A

Question



ASSIGNMENT:
Select ONE of the following languages:
C
C++
Java
For the language that you have selected, discuss how this language handles various design considerations (like data types, scopes etc.) You should also discuss why you think this language handles these design considerations well or not so well. You may also discuss other aspects of the language you have selected that makes the language more or less useful. You may also briefly discuss the history of the language appropriately.
__________________________________________________________________________

Make sure the following things

The minimum length of the paper should be 10 pages. Minimum length is excluding the front cover page

The font must not be larger than 12 pt. for main body of the paper. Normal margins should be used i.e. 1” on each side.

Please use APA style for writing your paper. Resources for the same have been provided as a separate file.

You may cite sources and references. Any quotes MUST be attributed to the sources.

In addition to explaining the features and information about the language, the paper must represent your thoughts and analysis and should not simply be a copy and paste of lecture material or internet sources.


Explanation / Answer

java is mainly designed to attain portability. The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. History of java: he Java language has undergone several changes since JDK 1.0 as well as numerous additions of classes and packages to the standard library. Since J2SE 1.4, the evolution of the Java language has been governed by the Java Community Process (JCP), which uses Java Specification Requests (JSRs) to propose and specify additions and changes to the Java platform. The language is specified by the Java Language Specification (JLS); changes to the JLS are managed under JSR 901. In addition to the language changes, much more dramatic changes have been made to the Java class library over the years, which has grown from a few hundred classes in JDK 1.0 to over three thousand in J2SE 5. Entire new APIs, such as Swing and Java2D, have been introduced, and many of the original JDK 1.0 classes and methods have been deprecated. Some programs allow conversion of Java programs from one version of the Java Platform to an older one (for example Java 5.0 backported to 1.4) (see Java backporting tools). DK 1.0 (January 23, 1996) Codename Oak. Initial release The first stable version was the JDK 1.0.2. is called Java 1 JDK 1.1 (February 19, 1997) Major additions included: an extensive retooling of the AWT event model inner classes added to the language JavaBeans JDBC RMI reflection which supported Introspection only, no modification at runtime was possible. [edit]J2SE 1.2 (December 8, 1998) Codename Playground. This and subsequent releases through J2SE 5.0 were rebranded retrospectively Java 2 and the version name "J2SE" (Java 2 Platform, Standard Edition) replaced JDK to distinguish the base platform from J2EE (Java 2 Platform, Enterprise Edition) and J2ME (Java 2 Platform, Micro Edition). Major additions included: strictfp keyword the Swing graphical API was integrated into the core classes Sun's JVM was equipped with a JIT compiler for the first time Java Plug-in Java IDL, an IDL implementation for CORBA interoperability Collections framework J2SE 1.3 (May 8, 2000) Codename Kestrel. The most notable changes were:[5][6] HotSpot JVM included (the HotSpot JVM was first released in April, 1999 for the J2SE 1.2 JVM) RMI was modified to support optional compatibility with CORBA JavaSound Java Naming and Directory Interface (JNDI) included in core libraries (previously available as an extension) Java Platform Debugger Architecture (JPDA) Synthetic proxy classes [edit]J2SE 1.4 (February 6, 2002) Codename Merlin. This was the first release of the Java platform developed under the Java Community Process as JSR 59. Major changes included:[7][8] Language changes assert keyword (Specified in JSR 41.) Library improvements regular expressions modeled after Perl regular expressions exception chaining allows an exception to encapsulate original lower-level exception Internet Protocol version 6 (IPv6) support non-blocking NIO (New Input/Output) (Specified in JSR 51.) logging API (Specified in JSR 47.) image I/O API for reading and writing images in formats like JPEG and PNG integrated XML parser and XSLT processor (JAXP) (Specified in JSR 5 and JSR 63.) integrated security and cryptography extensions (JCE, JSSE, JAAS) Java Web Start included (Java Web Start was first released in March, 2001 for J2SE 1.3) (Specified in JSR 56.) Preferences API (java.util.prefs) J2SE 5.0 (September 30, 2004) Codename Tiger. Originally numbered 1.5, which is still used as the internal version number. This version was developed under JSR 176. J2SE 5.0 entered its end-of-life on April 8, 2008 and is no longer supported by Sun as of November 3, 2009. Tiger added a number of significant new language features: Generics: Provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion). (Specified by JSR 14.) Metadata: Also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities. (Specified by JSR 175.) Autoboxing/unboxing: Automatic conversions between primitive types (such as int) and primitive wrapper classes (such as Integer). (Specified by JSR 201.) Enumerations: The enum keyword creates a typesafe, ordered list of values (such as Day.MONDAY, Day.TUESDAY, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern). (Specified by JSR 201.) Varargs: The last parameter of a method can now be declared using a type name followed by three dots (e.g. void drawtext(String... lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type. Enhanced for each loop: The for loop syntax is extended with special syntax for iterating over each member of either an array or any Iterable, such as the standard Collection classes, using a construct of the form: void displayWidgets (Iterable widgets) { for (Widget w: widgets) { w.display(); } } This example iterates over the Iterable object widgets, assigning each of its items in turn to the variable w, and then calling the Widget method display() for each item. (Specified by JSR 201.) Fix the previously broken semantics of the Java Memory Model, which defines how threads interact through memory. Static imports There were also the following improvements to the standard libraries: Automatic stub generation for RMI objects. Swing: New skinnable look and feel, called synth. The concurrency utilities in package java.util.concurrent. Scanner class for parsing data from various input streams and buffers. Java 5 is the last release of Java to officially support the Microsoft Windows 9x line (Windows 95, Windows 98, Windows ME). Unofficially, Java SE 6 Update 7 (1.6.0.7) is the last version of Java to be shown working on this family of operating systems. Java SE 6 (December 11, 2006) Codename Mustang. As of this version, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number. Internal numbering for developers remains 1.6.0. This version was developed under JSR 270. During the development phase, new builds including enhancements and bug fixes were released approximately weekly. Beta versions were released in February and June 2006, leading up to a final release that occurred on December 11, 2006. The current revision is Update 27 which was released in August 2011. Major changes included in this version: Support for older Win9x versions dropped. Unofficially Java 6 Update 7 is the last release of Java shown to work on these versions of Windows. This is believed to be due to the major changes in Update 10. Scripting Language Support (JSR 223): Generic API for tight integration with scripting languages, and built-in Mozilla JavaScript Rhino integration Dramatic performance improvements for the core platform,and Swing. Improved Web Service support through JAX-WS (JSR 224) JDBC 4.0 support (JSR 221). Java Compiler API (JSR 199): an API allowing a Java program to select and invoke a Java Compiler programmatically. Upgrade of JAXB to version 2.0: Including integration of a StAX parser. Support for pluggable annotations (JSR 269) Many GUI improvements, such as integration of SwingWorker in the API, table sorting and filtering, and true Swing double-buffering (eliminating the gray-area effect). JVM improvements include: synchronization and compiler performance optimizations, new algorithms and upgrades to existing garbage collection algorithms, and application start-up performance. Java 6 updates Java SE 7 (July 28, 2011) Java 7 (codename Dolphin) is a major update to Java which was launched on July 7 of 2011 and was made available on July 28, 2011. The development period was organized into thirteen milestones; on February 18, 2011, milestone 13, the last milestone was reached.On average, 8 builds (which generally included enhancements and bug fixes) were released per milestone. The Feature list at the Open JDK 7 project lists many of the feature changes. The feature additions for Java 7 JVM support for dynamic languages, following the prototyping work currently done on the Multi Language Virtual Machine Compressed 64-bit pointers Available in Java 6 with -XX:+UseCompressedOops Small language changes (grouped under a project named Coin): Strings in switch Automatic resource management in try-statement Improved type inference for generic instance creation Simplified varargs method invocation Binary integer literals Allowing underscores in numeric literals Catching multiple exception types and rethrowing exceptions with improved type checking Concurrency utilities under JSR 166 New file I/O library to enhance platform independence and add support for metadata and symbolic links. The new packages are java.nio.file and java.nio.file.attribute Library-level support for Elliptic curve cryptography algorithms An XRender pipeline for Java 2D, which improves handling of features specific to modern GPUs New platform APIs for the graphics features originally planned for release in Java version 6u10 Enhanced library-level support for new network protocols, including SCTP and Sockets Direct Protocol Upstream updates to XML and Unicode Lambda (Java upcoming implementation of Lambda programming), Jigsaw (Java upcoming implementation of modules), and part of Coin were dropped from Java 7. Java 8 will be implemented with the remaining features in late 2012.[67] Java SE 8 Java 8 is expected in October 2012 [68] and will include at a minimum the features that were planned for Java 7 but later deferred. Modularization of the JDK under Project Jigsaw[69][70] Language-level support for lambda expressions (officially, lambda expressions; unofficially, closures) under Project Lambda.[71] There was an ongoing debate in the Java community on whether to add support for lambda expressions.[72][73] Sun later declared that lambda expressions would be included in Java 8 and asked for community input to refine the feature.[74] Parts of project Coin that are not included in Java 7 Java Features: Platform Independent The concept of Write-once-run-anywhere (known as the Platform independent) is one of the important key feature of java language that makes java as the most powerful language. Not even a single language is idle to this feature but java is more closer to this feature. The programs written on one platform can run on any platform provided the platform must have the JVM. Simple There are various features that makes the java as a simple language. Programs are easy to write and debug because java does not use the pointers explicitly. It is much harder to write the java programs that can crash the system but we can not say about the other programming languages. Java provides the bug free system due to the strong memory management. It also has the automatic memory allocation and deallocation system. Object Oriented To be an Object Oriented language, any language must follow at least the four characteristics. Inheritance : It is the process of creating the new classes and using the behavior of the existing classes by extending them just to reuse the existing code and adding the additional features as needed. Encapsulation: : It is the mechanism of combining the information and providing the abstraction. Polymorphism: : As the name suggest one name multiple form, Polymorphism is the way of providing the different functionality by the functions having the same name based on the signatures of the methods. Dynamic binding : Sometimes we don't have the knowledge of objects about their specific types while writing our code. It is the way of providing the maximum functionality to a program about the specific type at runtime. As the languages like Objective C, C++ fulfills the above four characteristics yet they are not fully object oriented languages because they are structured as well as object oriented languages. But in case of java, it is a fully Object Oriented language because object is at the outer most level of data structure in java. No stand alone methods, constants, and variables are there in java. Everything in java is object even the primitive data types can also be converted into object by using the wrapper class. Robust Java has the strong memory allocation and automatic garbage collection mechanism. It provides the powerful exception handling and type checking mechanism as compare to other programming languages. Compiler checks the program whether there any error and interpreter checks any run time error and makes the system secure from crash. All of the above features makes the java language robust. Distributed The widely used protocols like HTTP and FTP are developed in java. Internet programmers can call functions on these protocols and can get access the files from any remote machine on the internet rather than writing codes on their local system. Portable The feature Write-once-run-anywhere makes the java language portable provided that the system must have interpreter for the JVM. Java also have the standard data size irrespective of operating system or the processor. These features makes the java as a portable language. Dynamic While executing the java program the user can get the required files dynamically from a local drive or from a computer thousands of miles away from the user just by connecting with the Internet. Secure Java does not use memory pointers explicitly. All the programs in java are run under an area known as the sand box. Security manager determines the accessibility options of a class like reading and writing a file to the local disk. Java uses the public key encryption system to allow the java applications to transmit over the internet in the secure encrypted form. The bytecode Verifier checks the classes after loading. Performance Java uses native code usage, and lightweight process called threads. In the beginning interpretation of bytecode resulted the performance slow but the advance version of JVM uses the adaptive and just in time compilation technique that improves the performance. ava uses the Unicode character set. Unicode is a two-byte character code set that has characters representing almost all characters in almost all human alphabets and writing systems around the world including English, Arabic, Chinese and more. Unfortunately many operating systems and web browsers do not handle Unicode. For the most part Java will properly handle the input of non-Unicode characters. The first 128 characters in the Unicode character set are identical to the common ASCII character set. The second 128 characters are identical to the upper 128 characters of the ISO Latin-1 extended ASCII character set. It's the next 65,280 characters that present problems. You can refer to a particular Unicode character by using the escape sequence u followed by a four digit hexadecimal number. For example u00A9 ? The copyright symbol u0022 " The double quote u00BD ? The fraction 1/2 u0394 ? The capital Greek letter delta u00F8 ? A little o with a slash through it You can even use the full Unicode character sequence to name your variables. However chances are your text editor doesn't handle more than basic ASCII very well. You can use Unicode escape sequences instead like this String Mju00F8lner = "Hammer of Thor"; but frankly this is way more trouble than it's worth. Multithreaded As we all know several features of Java like Secure, Robust, Portable, dynamic etc; you will be more delighted to know another feature of Java which is Multithreaded. Java is also a Multithreaded programming language. Multithreading means a single program having different threads executing independently at the same time. Multiple threads execute instructions according to the program code in a process or a program. Multithreading works the similar way as multiple processes run on one computer. Multithreading programming is a very interesting concept in Java. In multithreaded programs not even a single thread disturbs the execution of other thread. Threads are obtained from the pool of available ready to run threads and they run on the system CPUs. This is how Multithreading works in Java which you will soon come to know in details in later chapters. Interpreted We all know that Java is an interpreted language as well. With an interpreted language such as Java, programs run directly from the source code. The interpreter program reads the source code and translates it on the fly into computations. Thus, Java as an interpreted language depends on an interpreter program. The versatility of being platform independent makes Java to outshine from other languages. The source code to be written and distributed is platform independent. Another advantage of Java as an interpreted language is its error debugging quality. Due to this any error occurring in the program gets traced. This is how it is different to work with Java. Architecture Neutral The term architectural neutral seems to be weird, but yes Java is an architectural neutral language as well. The growing popularity of networks makes developers think distributed. In the world of network it is essential that the applications must be able to migrate easily to different computer systems. Not only to computer systems but to a wide variety of hardware architecture and Operating system architectures as well. The Java compiler does this by generating byte code instructions, to be easily interpreted on any machine and to be easily translated into native machine code on the fly. The compiler generates an architecture-neutral object file format to enable a Java application to execute anywhere on the network and then the compiled code is executed on many processors, given the presence of the Java runtime system. Hence Java was designed to support applications on network. This feature of Java has thrived the programming language. Java programming language is a language in which all the variables must be declared first and then to be used. That means to specify the name and the type of the variable. This specifies that Java is a strongly-typed programming language. Like int pedal = 1; This shows that there exists a field named 'pedal' that holds a data as a numerical value '1'. The values contained by the variables determines its data type and to perform the operations on it. There are seven more primitive data types which are supported by Java language programming in addition to int. A primitive data type is a data type which is predefined in Java. Following are the eight primitive data types: int It is a 32-bit signed two's complement integer data type. It ranges from -2,147,483,648 to 2,147,483,647. This data type is used for integer values. However for wider range of values use long. byte The byte data type is an 8-bit signed two's complement integer. It ranges from -128 to127 (inclusive). We can save memory in large arrays using byte. We can also use byte instead of int to increase the limit of the code. short The short data type is a 16-bit signed two's complement integer. It ranges from -32,768 to 32,767. short is used to save memory in large arrays. long The long data type is a 64-bit signed two's complement integer. It ranges from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Use this data type with larger range of values. float The float data type is a single-precision 32-bit IEEE 754 floating point. It ranges from 1.40129846432481707e-45 to 3.40282346638528860e+38 (positive or negative). Use a float (instead of double) to save memory in large arrays. We do not use this data type for the exact values such as currency. For that we have to use java.math.BigDecimal class. double This data type is a double-precision 64-bit IEEE 754 floating point. It ranges from 4.94065645841246544e-324d to 1.79769313486231570e+308d (positive or negative). This data type is generally the default choice for decimal values. boolean The boolean data type is 1-bit and has only two values: true and false. We use this data type for conditional statements. true and false are not the same as True and False. They are defined constants of the language. char The char data type is a single 16-bit, unsigned Unicode character. It ranges from 0 to 65,535. They are not same as ints, shorts etc. Java Operators An operator is a symbol that operates on one or more arguments to produce a result. The Hello World program is so simple it doesn't use any operators, but almost all other programs you write will. Operator Purpose + addition of numbers, concatenation of Strings += add and assign numbers, concatenate and assign Strings - subtraction -= subtract and assign * multiplication *= multiply and assign / division /= divide and assign % take remainder %= take remainder and assign ++ increment by one -- decrement by one > greater than >= greater than or equal to shift bits right with sign extension >>= shift bits right with sign extension and assign >>= unsigned bit shift right and assign The proper use of white space in programs Blank lines to separate blocks Use spaces instead of tabs Literals Literals are pieces of Java source code that mean exactly what they say. For instance "Hello World!" is a String literal and its meaning is the words Hello World! The string "Hello World!" looks like it's several things; but to the compiler it's just one thing, a String. This is similar to how an expression like 1,987,234 may be seven digits and two commas but is really just one number. The double quote marks tell you this is a string literal. A string is an ordered collection of characters (letters, digits, punctuation marks, etc.). Although the String may have meaning to a human being reading the code, the computer sees it as no more than a particular set of letters in a particular order. It has no concept of the meaning of the characters. For instance it does not know that "two" + "two" is "four." In fact the computer thinks that "two" + "two" is "twotwo" The quote marks show where the string begins and ends. However the quote marks themselves are not a part of the string. The value of this string is Hello World!, not "Hello World!" You can change the output of the program by changing Hello World to some other line of text. A string in a Java program has no concept of italics, bold face, font family or other formatting. It cares only about the characters that compose it. Even if you're using an editor like NisusWriter that lets you format text files, "Hello World!" is identical to "Hello World!" as far as Java is concerned. char literals are similar to string literals except they're enclosed in single quotes and must have exactly one character. For example 'c' is a char literal that means the letter c. true and false are boolean literals that mean true and false. Numbers can also be literals. 34 is an int literal and it means the number thirty-four. 1.5 is a double literal. 45.6, 76.4E8 (76.4 times 10 to the 8th power) and -32.0 are also double literals. 34L is a long literal and it means the number thirty-four. 1.5F is a float literal. 45.6f, 76.4E8F and -32.0F are also float literals. Identifiers in Java Identifiers are the names of variables, methods, classes, packages and interfaces. Unlike literals they are not the things themselves, just ways of referring to them. In the HelloWorld program, HelloWorld, String, args, main and println are identifiers. Identifiers must be composed of letters, numbers, the underscore _ and the dollar sign $. Identifiers may only begin with a letter, the underscore or a dollar sign. Each variable has a name by which it is identified in the program. It's a good idea to give your variables mnemonic names that are closely related to the values they hold. Variable names can include any alphabetic character or digit and the underscore _. The main restriction on the names you can give your variables is that they cannot contain any white space. You cannot begin a variable name with a number. It is important to note that as in C but not as in Fortran or Basic, all variable names are case-sensitive. MyVariable is not the same as myVariable. There is no limit to the length of a Java variable name. The following are legal variable names: MyVariable myvariable MYVARIABLE x i _myvariable $myvariable _9pins andros a?d??? OReilly This_is_an_insanely_long_variable_name_that_just_keeps_going_and_going_and_going_and_well_you_get_the_idea_The_line_br Tip: How to Begin a Variable Name with a Number If you want to begin a variable name with a digit, prefix the name you'd like to have (e.g. 8ball) with an underscore, e.g. _8ball. You can also use the underscore to act like a space in long variable names. Keywords Keywords are identifiers like public, static and class that have a special meaning inside Java source code and outside of comments and Strings. Four keywords are used in Hello World, public, static, void and class. Keywords are reserved for their intended use and cannot be used by the programmer for variable or method names. Keywords Used in Java 1.1 Keyword Purpose boolean declares a boolean variable or return type byte declares a byte variable or return type char declares a character variable or return type double declares a double variable or return type float declares a floating point variable or return type short declares a short integer variable or return type void declare that a method does not return a value int declares an integer variable or return type long declares a long integer variable or return type while begins a while loop for begins a for loop do begins a do while loop switch tests for the truth of various possible cases break prematurely exits a loop continue prematurely return to the beginning of a loop case one case in a switch statement default default action for a switch statement if execute statements if the condition is true else signals the code to be executed if an if statement is not true try attempt an operation that may throw an exception catch handle an exception finally declares a block of code guaranteed to be executed class signals the beginning of a class definition abstract declares that a class or method is abstract extends specifies the class which this class is a subclass of final declares that a class may not be subclassed or that a field or method may not be overridden implements declares that this class implements the given interface import permit access to a class or group of classes in a package instanceof tests whether an object is an instanceof a class interface signals the beginning of an interface definition native declares that a method is implemented in native code new allocates a new object package defines the package in which this source code file belongs private declares a method or member variable to be private protected declares a class, method or member variable to be protected public declares a class, method or member variable to be public return returns a value from a method static declares that a field or a method belongs to a class rather than an object super a reference to the parent of the current object synchronized Indicates that a section of code is not thread-safe this a reference to the current object throw throw an exception throws declares the exceptions thrown by a method transient This field should not be serialized volatile Warns the compiler that a variable changes asynchronously Two other keywords, const and goto, are reserved by Java but are not actually implemented. This allows compilers to produce better error messages if these common C++ keywords are improperly used in a Java program. Java 1.2 adds the strictfp keyword to declare that a method or class must be run with exact IEEE 754 semantics. Java 1.4 adds the assert keyword to specify assertions. Java 5 adds assert and enum. true and false appear to be missing from this list. In fact, they are not keywords but rather boolean literals. You still can't use them as a variable name though. Separators in Java Separators help define the structure of a program. The separators used in HelloWorld are parentheses, ( ), braces, { }, the period, ., and the semicolon, ;. The table lists the six Java separators (nine if you count opening and closing separators as two). Separator Purpose ( ) Encloses arguments in method definitions and calling; adjusts precedence in arithmetic expressions; surrounds cast types and delimits test expressions in flow control statements { } defines blocks of code and automatically initializes arrays [ ] declares array types and dereferences array values ; terminates statements , separates successive identifiers in variable declarations; chains statements in the test, expression of a for loop . Selects a field or method from an object; separates package names from sub-package and class names : Used after loop labels Casting: A cast lets the compiler know that you're serious about the conversion you plan to make. When a value is cast down before assignment, series of operations takes place to chop the right hand side down to size. For a conversion between a floating point number and an int or a long, the fractional part of the floating point number is truncated (rounded toward zero). This produces an integer. If the integer is small enough to fit in the left hand side, the assignment is completed. On the other hand if the number is too large, then the integer is set to the largest possible value of its type. If the floating point number is too small the integer is set to the smallest possible value of its type. This can be a nasty bug in your code. It can also be hard to find since everything may work perfectly 99 times out of a hundred and only on rare occasions will the rounding become a problem. However when it does there will be no warning or error message. You need to be very careful when assigning floating point values to integer types. Scope and lifetime of a variable in java: The scope of a variable is the part of the program over which the variable name can be referenced. (from Ivor Horton's Beginning Java 2, JDK 5 Edition by Ivor Horton) You cannot refer to a variable before its declaration. You can declare variables in several different places: In a class body as class fields. Variables declared here are referred to as class-level variables. As parameters of a method or constructor. In a method's body or a constructor's body. Within a statement block, such as inside a while or for block. Variable scope refers to the accessibility of a variable. The rule 1 is that variables defined in a block are only accessible from within the block. The scope of the variable is the block in which it is defined. For example, consider the following for statement. public class MainClass { public static void main(String[] args) { for (int x = 0; x < 5; x++) { System.out.println(x); } } } Rule number 2 is a nested block can access variables declared in the outer block. Consider this code. public class MainClass { public static void main(String[] args) { for (int x = 0; x < 5; x++) { for (int y = 0; y < 3; y++) { System.out.println(x); System.out.println(y); } } } } Variables declared as method parameters can be accessed from within the method body. Class-level variables are accessible from anywhere in the class. If a method declares a local variable that has the same name as a class-level variable, the former will 'shadow' the latter. To access the class-level variable from inside the method body, use the this keyword. variable scope in a block: public class MainClass { public static void main(String[] args) { int outer = 1; { int inner = 2; System.out.println("inner = " + inner); System.out.println("outer = " + outer); } int inner = 3; System.out.println("inner = " + inner); System.out.println("outer = " + outer); } }