Results 1 to 3 of 3
Thread: Default imported packages
- 01-10-2011, 06:03 PM #1
Member
- Join Date
- Nov 2010
- Posts
- 9
- Rep Power
- 0
Default imported packages
As java.lang.* is default imported package.Yet, Exception need java.lang.Exception to be imported. Why?
eg:
import java.io.*;
import java.lang.*;
public class Main
{
public static void main(String args[])
{
BufferedReader br = new BufferedReader(new InputSteamReader(system.in));
string name;
try
{
name = br.readLine();
}
catch(Exception e)
{
System.out.println("exception is caught here.");
}
}
}
- 01-10-2011, 06:36 PM #2
Senior Member
- Join Date
- Oct 2010
- Location
- Germany
- Posts
- 780
- Rep Power
- 4
:confused::confused:
You dont have a import error here, you have other errors ;D
Java Code:public class Main { public static void main(String args[]) { BufferedReader br = new BufferedReader(new InputSt[COLOR="Red"]r[/COLOR]eamReader([COLOR="Red"]S[/COLOR]ystem.in)); [COLOR="Red"]S[/COLOR]tring name; try { name = br.readLine(); } catch (Exception e) { System.out.println("exception is caught here."); } } }
- 01-11-2011, 06:20 AM #3
Member
- Join Date
- Nov 2010
- Posts
- 9
- Rep Power
- 0
Similar Threads
-
how can downloaded package be imported in java
By aldm in forum New To JavaReplies: 3Last Post: 10-08-2010, 10:16 AM -
show the comment in the imported class
By javastuden in forum New To JavaReplies: 5Last Post: 08-31-2010, 10:37 AM -
Is the imported package foo beeing used in the programm
By cthulhufhtagn in forum New To JavaReplies: 3Last Post: 11-01-2009, 04:27 PM -
[SOLVED] Access to default session deniedAccess to default session denied
By jazz2k8 in forum NetworkingReplies: 1Last Post: 03-10-2009, 01:12 PM -
Importing packages from the packages within same application.
By sta2003 in forum New To JavaReplies: 3Last Post: 02-12-2008, 11:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks