Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

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: 43016
76
  • 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: 43016
76
  • 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 "*".
 
What could go wrong in a swell place like "The Evil Eye"? Or with this tiny ad?
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic