• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DOUT ON PACKAGES.

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What do we mean by package in core java ? why is it used ?Can you give me an example program explaining it?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Core Java" is generally understood to mean the classes that come with J2SE, in other words, everything listed here.

It does not include other classes, like the ones that make up J2EE, nor any 3rd party libraries (like the ones in the Jakarta Commons libraries), nor any classes you develop.
 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Package means to import the header file.
i.e., we know C and C++, every program to include the header file then
#include<stdio.h> or
#include<iostream.h>
That's similar for package in Java language.
First i give basic syntax:
import package-name.*;
For example we have import existing package,
import java.io.*;
import --------> Keyword
java --------> packagename
io --------> classname (Existing class for io)

That line to connect the existing io methods(Functions).
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


import java.io.*;
import --------> Keyword
java --------> packagename
io --------> classname


Not quite. "java.io" is the full package name (packages can be hierarchical in Java). All classes of the java.io package are imported by way of the "*".
 
I am mighty! And this is a mighty small ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic