Forums.Sureshkumar.net : A Perfect Place to Share Knowledge         Blogs     Games    Magazines    

"Sharing knowledge does not lessen your store, often it gets you more. Sharing plays a key role in relationships and bonding, happens in small steps and is assisted through community membership."

Go Back   SURESHKUMAR.NET FORUMS > TECHNICAL DISCUSSIONS > JAVA Technologies
Register FAQ Members List Calendar Games Blogs Search Today's Posts Mark Forums Read

   

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 18-02-06, 07:43 AM   #1 (permalink)
Member
 
Join Date: Feb 2006
Location:
Posts: 42
Thanks: 0
Thanked 5 Times in 3 Posts
Thanks: 0
Thanked 5 Times in 3 Posts
Rep Power: 3 naga has disabled reputation
Packages
A package is a grouping of classes that share a common purpose or category. One member of a package has special privileges to access data and methods in other members of the package, hence the protected access modifier.A package is the Java equivalent of a library. It is a collection of classes which can be made available using the import statement. The following Java statement imports the utility library from the Java API:
import java.util.*
Packages are typically held in JAR files, which have the extension .jar or .zip.
Public versus private
An access modifier determines the visibility (essentially the public, private, or protected keyword used in front of any declaration) of a field, method or class to other Java objects.
•A public class, method, or field is visible everywhere.
•A private class, method, or field is visible only in methods defined within that class.
•A protected method or field is visible to methods defined within that class, within sublclasses of the class, or within other classes in the same package.
•The default visibility, known as package, means that the method or field is visible within the class and to other classes in the same package.
Constructors
A constructor is a special method of a Java class that is called when an instance of the class is created.
Classes can define their own constructors, including multiple, overriding constructors. Which arguments were used in the attempt to create the object determine which constructor is used. When the type, number, and order of arguments used to create an instance of the class match one of the class's constructors, that constructor is used when creating the object.
Garbage collection
Garbage collection automatically removes any object with no references to it, with the exception of objects stored as values in a table.
There is no such thing as a destructor method in Java (as there is in C++). Java classes can define their own finalize method for clean up operations when an object is discarded during garbage collection.
Interfaces
Java classes can inherit only from one class. Java uses interfaces instead of multiple-inheritance. A class can implement multiple interfaces. Each interface defines a set of methods and method profiles that must be implemented by the class for the class to be compiled.
An interface defines what methods and static fields the class must declare. The implementation of the methods and fields declared in an interface is located within the class that uses the interface: the interface defines what the class must declare; it is up to the class to determine how it is implemented.
Java error handling
Java error handling code is separate from the code for normal processing.
Errors generate an exception object representing the error. This is called throwing an exception. A thrown exception terminates a Java program unless it is caught and handled properly at some level of the application.
Both Java API classes and custom-created classes can throw exceptions. In fact, users can create their own exception classes which throw their own custom-created classes.
If there is no exception handler in the body of the method where the exception occurred, then the search for an exception handler continues up the call stack. If the top of the call stack is reached and no exception handler has been found, the default exception handler of the Java interpreter running the application is called and the program terminates.
In Adaptive Server Anywhere, if a SQL statement calls a Java method, and an unhandled exception is thrown, a SQL error is generated.
Error types in Java
All errors in Java come from two types of error classes: Exception and Error. Usually, Exception-based errors are handled by error handling code in your method body. Error type errors are specifically for internal errors and resource exhaustion errors inside the Java run-time system.
Exception class errors are thrown and caught. Exception handling code is characterized by try, catch, and finally code blocks.
A try block executes code that may generate an error. A catch block is code that executes if the execution of a try block generates (or throws) an error.
A finally block defines a block of code that executes regardless of whether an error was generated and caught and is typically used for cleanup operations. It is used for code that, under no circumstances, can be omitted.
There are two types of exception class errors: those that are runtime exceptions and those that are not runtime exceptions.
Errors generated by the runtime system are known as implicit exceptions, in that they do not have to be explicitly handled as part of every class or method declaration.
For example, an array out of bounds exception can occur whenever an array is used, but the error does not have to be part of the declaration of the class or method that uses the array.
All other exceptions are explicit. If the method being invoked can throw an error, it must be explicitly caught by the class using the exception-throwing method, or this class must explicitly throw the error itself by identifying the exception it may generate in its class declaration. Essentially, explicit exceptions must be dealt with explicitly. A method must declare all the explicit errors it throws, or catch all the explicit errors that may potentially be thrown.
Non-runtime exceptions are checked at compile time. Java catches many such errors during compilation, before running the code.
Every Java method is given an alternative path of execution so that all Java methods complete, even if they are unable to complete normally. If the type of error thrown is not caught, it's passed to the next code block or method in the stack.
naga is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 18-02-06, 09:43 AM   #2 (permalink)
Senior Member
 
Join Date: Jan 2006
Posts: 976
Thanks: 0
Thanked 27 Times in 20 Posts
Thanks: 0
Thanked 27 Times in 20 Posts
Rep Power: 14 HELP has disabled reputation
[img]smileys/smiley32.gif[/img] Good job man. Keep it UP


__________________
WE WISH YOU ALL THE BEST
SURESHKUMAR.NET TEAM
HELP is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 18-02-06, 10:00 AM   #3 (permalink)
Moderator
 
Join Date: Feb 2006
Posts: 1,413
Thanks: 0
Thanked 9 Times in 8 Posts
Thanks: 0
Thanked 9 Times in 8 Posts
Rep Power: 18 sowmya571 has disabled reputation
hello naga



one small reques gud that ur posting things but post properly ya



its so clustered naga .. try to make it more readable atleast for my sake [img]smileys/smiley17.gif[/img] (hahhaa)





bye



sowmya




__________________
http://livetolead.blogspot.com/
all the best
Arise Awake N Stop Not Until Ur Goal Is Reached!
sowmya571 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22-09-06, 02:05 AM   #4 (permalink)
Junior Member
 
Join Date: Sep 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 3 jkirthi4 is on a distinguished road
Re: java notes

Hi naga,
Notes is good. But my suggestion is....instead of touching many topics...go deep in one topic with program ,example,why,where it is used...and all.....iam sorry.Dont mind.
All the best.

Last edited by jkirthi4; 22-09-06 at 02:09 AM.
jkirthi4 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22-09-06, 10:52 AM   #5 (permalink)
Moderator
 
kiran2710's Avatar
 
Join Date: Jul 2006
Posts: 2,184
Thanks: 5
Thanked 371 Times in 255 Posts
Thanks: 5
Thanked 371 Times in 255 Posts
Rep Power: 58 kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute kiran2710 has a reputation beyond repute
Re: java notes

Nice post...

Keep posting..
__________________



Kiran







kiran2710 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 22-09-06, 10:30 PM   #6 (permalink)
Technical GURU
 
BINNY's Avatar
 
Join Date: Feb 2006
Location: India
Posts: 805
Thanks: 4
Thanked 19 Times in 15 Posts
Thanks: 4
Thanked 19 Times in 15 Posts
Blog Entries: 2
Rep Power: 14 BINNY has a spectacular aura about BINNY has a spectacular aura about BINNY has a spectacular aura about BINNY has a spectacular aura about
Re: java notes

HI Naga,

Please dont post unformatted text. It is very difficult to read the content . So , I suggest u to post the content in a neatly and orderly manner.
__________________
BINNY
BINNY is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT +6.5. The time now is 03:14 AM.





Search Engine Optimization by vBSEO 3.1.0