Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Class Libraries !! ?

Thread view: 
Salman - 25 Mar 2007 11:00 GMT
Hi,
im c++ programmer and new to Java.
Im reading book of Java by deitel and deitel
i read a line from the very first chapter and got confused coz its
meaning is different if i take it as c++ programmer. Kindly explain me
the following line.

Line is:
"Java contains class libraries Known as Java APIs (Application
Programming Interfaces)"

what is meant by class libraries? class are different and libraries
are differnet in c++???
Chris Uppal - 25 Mar 2007 11:11 GMT
> what is meant by class libraries? class are different and libraries
> are differnet in c++???

A "library" in programming is a collection of code.  In Java, all code comes as
classes, so a library must be a collection of classes.  So we talk about the
"class libraries" -- collections of classes which between them make up
libraries of Java code.

   -- chris
Alexander D. B. Kim - 25 Mar 2007 11:20 GMT
Hi Salman,

You said you're a C++ programmer, right? =) then it's quite simple.
I guess you have at least experienced MFC or Microsoft Foundation
Classes. Java API is similar with MFC =P (somebody will get angry
about my explanation!)

If you don't know about MFC... hum... then think about functions in
the C programming language like printf() or scanf(). They are built-in
functions, right? Like the functions, Java API is a set of classes
built-in for JAVA programmer's easier life =)

I think you misinterpret what the line says. The line says "Java
contains CLASS LIBRARIES..." it mean JAVA provides a set of classes as
a library. =) I was also confused about different concepts between
JAVA and C++. In my opinion, JAVA was the easiest programming language
(before C#... sorry guys) because there is NO POINTER at all =)
Actually, I think everything is based on pointer in JAVA =P.

Good luck with learning JAVA =) HAVE FUN!

Cheers,

> Hi,
> im c++ programmer and new to Java.
[quoted text clipped - 9 lines]
> what is meant by class libraries? class are different and libraries
> are differnet in c++???
Lew - 25 Mar 2007 15:55 GMT
In my opinion, JAVA was the easiest programming language
> (before C#... sorry guys) because there is NO POINTER at all =)
> Actually, I think everything is based on pointer in JAVA =P.

You raise important points that were discussed in detail in the clj.programmer
thread "Pointers in Java: Was Re: Strings...immutable?". You did a nice job of
summarizing the entire thread:

Point: In Java (not "JAVA",btw), there are no pointers.
Counterpoint: Everything (except primitives) is based on pointers in Java.

The first is false, but true. The second is true, but false.

There are no /C-style/ pointers in Java, that is, you cannot do pointer
arithmetic, pointers point only to values not variables, and other
differences. So the "point" is sort of true, but not really - (non-primitive)
variables in Java actually are pointers, a.k.a. references, to objects in memory.

Object-typed variables are all pointers in Java, but not everything in Java is
a variable. So the "counterpoint" is really false, but has a sloppy truth to
it. It is more accurate to distinguish between variables (pointers) and the
objects to which they point (values).

The important thing is that there are no C-style pointers in Java, but there
are Java-style pointers. These are different species of pointer, like bats and
whales are different species of mammal. Dig into the referenced thread if you
want details.

-- Lew
Alexander D. B. Kim - 25 Mar 2007 20:36 GMT
That's a crystal clear explanation on the concept of referencing
objects in JAVA. =) Moreover, in my opinion, that's the reason why
JAVA is called successor of the C++ programming language in terms of
"O-O" concept and programmers or readers feel it is easier than C++.
Am I right? =P

JAVA is a awesome programming language because it allows programmers
or development build their application for almost any platforms
whereas C# generally focuses on Windows platform only (I know there is
Mono and GNU.NET which also provides multi-platform envrionment).

By the way, thanks for your better explanation =)

Cheers,

> In my opinion, JAVA was the easiest programming language
>
[quoted text clipped - 26 lines]
>
> -- Lew
Lew - 25 Mar 2007 21:02 GMT
> By the way, thanks for your better explanation =)

Your future lack of top-posting will be thanks enough. :-)

(That's a sort-of in-joke on this group.)

Top-posting is when you place your answer above the material you quote. It's
more readable to quote in line - a bit of quoted material, your reply, quoted
material, reply, ..., interleaved. Also you should freely edit out anything no
longer relevant, since the newsgroup is available for old verbiage if needed.

I am gratified that you found my blather somewhat useful. The explanations in
the cited thread were its inspiration.

-- Lew
Joshua Cranmer - 25 Mar 2007 21:24 GMT
> Hi,
> im c++ programmer and new to Java.
[quoted text clipped - 9 lines]
> what is meant by class libraries? class are different and libraries
> are differnet in c++???

I remember reading Deitel and Deitel -- one of the better books on Java.

A library in Java is similar to a library in C, Fortran, COBOL, PHP,
etc. It is a collection of functions (aggregated into classes per the OO
principles) that performs normal functions. The class library is merely
a qualifier that accentuates the fact that these libraries are formed as
packages containing classes which contains these accessor functions.

In general reference, the "Java APIs" is more commonly used to refer to
the Javadoc output of the J2SE system (accessible at
http://java.sun.com/j2se/1.5.0/docs/api/index.html for Java 1.5 and
http://java.sun.com/javase/6/docs/api/index.html for Java 6).

Also, try fixing that sticky ! key.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.