Home > Programming > Java Programming



Effective Java(TM) Programming Language Guide

Sort Desciption:

Java programming language shares many similarities with the C program ... construct was omitted from the Java programming language because ...



Content Inside:

Effective Java(TM) Programming Language GuidePage 197C H A P T E R5Substitutes for C ConstructsTHEJava programming language shares many similarities with the C programming language but several C constructs have been omitted. In most cases its obvious why a C construct was omitted and how to make do without it. This chaptersuggests replacements for several omitted C constructs whose replacements are notso obvious.The common thread that connects the items in this chapter is that all of theomitted constructs are dataoriented rather than objectoriented. The Java programming language provides a powerful type system and the suggested replacements take full advantage of that type system to deliver a higher qualityabstraction than the C constructs they replace.Even if you choose to skip this chapter its probably worth reading Item 21which discusses the typesafe enum pattern a replacement for Cs enumconstruct.This pattern is not widely known at the time of this writing and it has several advantages over the methods currently in common use.Item 19: Replace structures with classesThe Cstructconstruct was omitted from the Java programming language becausea class does everything a structure does and more. A structure merely groups multiple data fields into a single object; a class associates operations with the resultingobject and allows the data fields to be hidden from users of the object. In otherwords a class can encapsulate its data into an object that is accessed solely by itsmethods allowing the implementor the freedom to change the representation overtime (Item 12).Upon first exposure to the Java programming language some C programmersbelieve that classes are too heavyweight to replace structures under some circumPage 2CHAPTER 5 SUBSTITUTES FOR C CONSTRUCTS98stances but this is not the case. Degenerate classes consisting solely of data fieldsare loosely equivalent to C structures:// Degenerate classes like this should not be public!class Point {public float x;public f ...

Source: www.ilsant.com


add to Google Reader add to Google Bookmark add to bloglines add to newsgator add to FURL add to digg add to webnews add to Netscape add to Yahoo MyWeb add to spurl.net add to diigo Bookmark newsvine Bookmark del.icio.us Bookmark @ SIMPIFY Bookmark MISTER WONG Bookmark Linkarena Bookmark icio.de Bookmark oneview Bookmark folkd.com Bookmark yigg.de Bookmark reddit Bookmark StumbleUpon Bookmark Slashdot Bookmark blinklist Bookmark technorati add to blogmarks add to blinkbits add to ma.gnolia add to smarking.com add to netvouz add to co.mments add to Connotea add to de.lirio.us

 

Related Files

<>An Introduction to Java Programming

Filed under: Programming and Java Programming
Type java Welcome to run the program. A sample run of ... You can run the Java program from the DOS prompt using. the java command. ...

Java Server Programming: Principles and Technologies

Filed under: Programming and Java Programming
largescale serverside applications using the Java programming language. ... Professional java server programming J2EE edition. Wrox Press Inc. ...

Java Programming Language SL275

Filed under: Programming and Java Programming
language; objectoriented programming. with the Java programming language; and ... SL275: Java Programming Language. 2 of 5. Sun Educational Services ...

Java 2 Enterprise Edition (J2EE) Certificate Program

Filed under: Programming and Java Programming
that are available with the Java programming language. and development environment. .... database tasks and transactions from a Java program. ...

Programming mobile devices with J2ME

Filed under: Programming and Java Programming
Java's interfaces, with the possibility of using a layer programming structure in ... For example the access to a built-in camera in a mobile phone by means of ...