Skip to main content

Posts

Showing posts with the label IntroJava

Cafe Babe? Or, what's in a name?

    The name Java is not an acronym. In particular, it does not stand for Just Another Vague Acronym . The language was originally called Oak, but the language lawyers worried about the name Oak Technology (at the time a maker of video cards). So a meeting was held (varying accounts of that meeting were gathered up by JavaWorld) , and the name Java made the short list. The language lawyers approved, and the rest is history. Most kinds of executable file formats have some kind of "magic number" that identifies them. For example, old PDP-11 executables for the UNIX system used the "magic number" 0407 (the real magic there, and the putative origin of the term, is that 0407 was a machine instruction for a jump forward of 7 words, i.e., past the 8-word-long executable header, to the first executable statement in the program). Some versions of the Berkeley UNIX memory allocator use the hexadecimal string 0xDEADBEEF, which is considered unlikely to occur in normal o...

Fundamental Building Blocks of Programs

T here are two basic aspects of programming: data and instructions. To work with data, you need to understand variables and types ; to work with instructions, you need to understand control structures and subroutines . You'll spend a large part of the course becoming familiar with these concepts. A variable is just a memory location (or several locations treated as a unit) that has been given a name so that it can be easily referred to and used in a program. The programmer only has to worry about the name; it is the compiler's responsibility to keep track of the memory location. The programmer does need to keep in mind that the name refers to a kind of "box" in memory that can hold data, even if the programmer doesn't have to know where in memory that box is located. In Java and in many other programming languages, a variable has a type that indicates what sort of data it can hold. One type of variable might hold integers -- whole numbers such as ...

What is Java Virtual Machine (JVM)

--------------Note on JavaVirtual Machine-------------- • The Java Language runs on a “Java Virtual Machine” – Java Virtual machine abstracts away the details of theunderlying platform and provides a uniform environment for executing Java“byte-code” • The Java compiler (javac) compiles Java code intobyte-code – Bytecode is an intermediate form which can run on theJVM – JVM does the translation from byte-code to machine-codein a platform dependent way.

Explain Difference between Java and C++

C++ Java C++ is a complex language Java is Simple Language C++ has signed and unsigned data types By default, all data types in java are signed( Exception char) Characters in C++ are 8 bit and 16 bit chars are represented by wide character types By default all the characters 16 bit and supports Unicode C++ supports pointers and pointer arithmetic No low-level pointers or pointer arithmetic. Instead have variables and expressions of reference type. Objects needs to be deallocated explicitly using destructors Objects are Garbage collected automatically Variables can be used before its initialization No Variable can be used before its initialization Array bounds are not checked by default Strict array bounds checking No built in support for multithreading. Built in support for multithreading Struct,union , typedef available No struct, union, typedef—classes and objects are used uniformly instead. C++ platform dependent Java is platform independent and machine independent C++ is...

Explain Features of Java - Introduction

1) Simple • Similar to C/C++ in syntax • But eliminates several complexities of – No operator overloading – No direct pointer manipulation or pointer arithmetic – No multiple inheritance – No malloc() and free() – handles memory automatically – Garbage Collector • Lots more things which make Java more attractive. 2) Object-Oriented • Fundamentally based on OOP – Classes and Objects – Uses a formal OOP type system – Lends an inherent structure/organization for how wewrite Java programs • Unlike spaghetti code in languages like Perl – Efficient re-use of packages such that the programmeronly cares about the interface and not the implementation 3) Distributed / Network Oriented • Java grew up in the days of the Internet – Inherently network friendly – Original release of Java came with Networking libraries – Newer releases contain even more for handlingdistributed applications...

JAVA Tutorial 1- Introduction to Java

•          Java was developed by James Gosling at Sun Microsystems in 1991. •          His Original Aim was to develop a low cost, Hardware Independent Language based on C++. •          Due to technical reasons that idea was dropped. •          A new programming Language called Oak was developed based on C++. •          The language oak was developed by removing undesirable features of C++. •          Those features include: •          Multiple Inheritance •          Automatic type conversions •          Use of pointers •          Memory Management. •    ...