Academic Tutorials

English | French | Portugese | German | Italian
Home Advertise Payments Recommended Websites Interview Questions FAQs
News Source Codes E-Books Downloads Jobs Web Hosting

Java Tutorial
Java Introduction
Object Oriented Programming Concepts
Anatomy of a Java Application
Syntax and Semantics of Java
Java Objects, Classes, and Interfaces
The String and StringBuffer Classes in Java
Setting Program Attributes in Java
Using System Resources in Java
Threads of Control in Java
Errors and Exceptions in Java
Java Input and Output Streams
Overview of Java Applet
Creating an Applet User Interface in Java
Communicating with Other Programs in Java
Overview of the Java UI
Using GUI Building Blocks in Java
Laying Out Components within a Container
Working with Graphics in Java
How Java Differs from C and C++
Java Summary

HTML Tutorials
HTML Tutorial
XHTML Tutorial
CSS Tutorial
TCP/IP Tutorial
CSS 1.0
CSS 2.0
XML Tutorials
XML Tutorial
XSL Tutorial
XSLT Tutorial
DTD Tutorial
Schema Tutorial
XForms Tutorial
XSL-FO Tutorial
XML DOM Tutorial
XLink Tutorial
XQuery Tutorial
XPath Tutorial
XPointer Tutorial
RDF Tutorial
SOAP Tutorial
WSDL Tutorial
RSS Tutorial
WAP Tutorial
Web Services Tutorial
Browser Scripting
JavaScript Tutorial
VBScript Tutorial
DHTML Tutorial
HTML DOM Tutorial
WMLScript Tutorial
E4X Tutorial
Server Scripting
ASP Tutorial
PERL Tutorial
SQL Tutorial
ADO Tutorial
Apple Script
PL/SQL Tutorial
SQL Server
.NET (dotnet)
.Net Mobile
C# : C Sharp
SVG Tutorial
Flash Tutorial
Media Tutorial
SMIL Tutorial
Photoshop Tutorial
Gimp Tutorial
Gnuplot Programming
GIF Animation Tutorial
Scientific Visualization Tutorial
Web Building
Web Browsers
Web Hosting
W3C Tutorial
Web Building
Web Quality
Web Semantic
Web Careers
Weblogic Tutorial
Web Site Hosting
Domain Name
Java Tutorials
Java Tutorial
JSP Tutorial
Servlets Tutorial
Struts Tutorial
EJB Tutorial
JMS Tutorial
JMX Tutorial
Programming Langauges
C Tutorial
C++ Tutorial
Visual Basic Tutorial
Data Structures Using C
Assembly Language
Forth Programming
Lisp Programming
Data Warehousing
CGI Programming
Emacs Tutorial
Soft Skills
Communication Skills
Time Management
Project Management
Team Work
Leadership Skills
Corporate Communication
Negotiation Skills
Database Tutorials
Operating System
Software Testing
SAP Module
Business Warehousing
SAP Basis
Material Management
Sales & Distribution
Human Resource
Customer Relationship Management
Production and Planning
Networking Programming
Corba Tutorial
Networking Tutorial
Microsoft Office
Microsoft Word
Microsoft Outlook
Microsoft PowerPoint
Microsoft Publisher
Microsoft Excel
Microsoft Front Page
Microsoft InfoPath
Microsoft Access
Financial Accounting
Managerial Accounting
Network Sites

Java Summary



What is Object?

The real-world objects(any living or non- living thing) share two characteristics: they do have state and behaviour. For example, dogs have a state ( like name, color, etc) and behaviour ( like barking, fetching etc). Also consider for example a Bicycles have a state such as current gear, current wheels, number of gears etc and and behaviour such as braking, accelerating etc.
After the real-world objects Software objects have been modelled in that, they too,have states and behaviours. A software object maintains states in the variables and implements behaviour by methods.

The Benefit of Encapsulation

  • Modular programming-- The source code for any of the object can be written and maintained independently from those of the source code written for other objects. Also, an object can be easily used passing around in the system. For example you can give your bicycle to someone else and it will still work for them too.

  • Information hiding-- An object has a public interface by which other objects can communicate with it. But on the other hand objects can maintain private information and methods that cannot be communicated to others.

The Benefit of Messages

  • Since everything that an object can do is expressed through its methods, message passing supports all possible interactions between objects.

  • To send and receive messages back and forth objects don't need to be in the same process or even on the same machine.

The Benefit of Classes

Objects provide the benefit of modularity and information hiding. Classes provide the benefit of reusability. Bicycle manufacturers reuse the same blueprint over and over again to build lots of bicycles. Software programmers use the same class over and over to again create many objects.

The Benefit of Inheritance

  • Subclasses provide specialized behaviours from the basis of common elements provided by the superclass. Through the use of inheritance, programmers can reuse the code in the superclass many times.

  • Programmers can implement superclasses that define "generic" behaviours (called abstract classes). The essence of the superclass is defined and may be partially implemented but much of the class is left undefined and unimplemented. Other programmers fill in the details with specialized subclasses.


These are some of the rules on constructors:

  • private constructors()- keyword used "private", no one can instantiate the class as object. But can still expose public static methods, and these methods can construct object and return it, but no one else can do this.
  • package constructors() - None of them outside your package can construct an instance of your class. This is useful when you want to have classes in your package which can do new yourClass() and don't want to let anyone else to do this.
  • protected constructors() - keyword used "protected" only the subclasses of your class can make use of this package.
  • public constructors() - keyword used "public" the generic constructor will use these.

Setting Program Attributes

A program typically needs this information about the system and application environment to make decisions about how to do something, or what to do. Also, a program may wish to modify certain attributes itself, or allow a user to change them. Thus a program needs to be able to read and write various system attributes and program-specific attributes. Java programs can manage these attributes through three mechanisms: properties, application command line arguments, and applet parameters.

  • Properties
    Use properties to define environmental attributes on a persistent basis. That is, use properties when they need to be in effect for each invocation of a program.
  • Application Command Line Arguments
    Use command line arguments to define or modify environmental attributes on a non-persistent basis. That is, use command line arguments to change one or more attributes for just one invocation of a program.
  • Applet Parameters
    Use applet parameters to define or modify environmental attributes on a non-persistent basis for applets. That is, use parameters to set one or more attributes for a single invocation of an applet.

What is Thread?

Programmers are familiar with writing sequential programs. The program that displays "Hello World!", or program which sorts a list of names, or computes the list of prime numbers, are sequential all programs: each has beginning, end, sequence, and at any given time during runtime of program there is single point of execution.

A thread is similar to a sequential program, a single thread do also has beginning, end, sequence, and at any given time during runtime of thread there will be a single point of execution. But the thread itself is not a program it cannot run by itself but runs within the program.

An applet can communicate with the other programs in three different ways:

  • By invoking the public methods of other applets on the same page
  • By using an API defined in the java.applet package, which allows it to communicate in limited way with a browser or applet viewer that contains it.
  • By using the API defined in the package to communicate over network with the other programs. Other programs must be running on a host which the applet originated from.

How to Choose a Layout Manager

AWT-provided layout managers have different strengths and weakness. This section discusses some of the common layout scenarios and which AWT layout managers may work for each scenario. If none of the AWT layout managers is right for our situation, we should use layout managers contributed to the net.

  • Scenario: We need to display a component in as much space as it can. Consider using the BorderLayout or GridBagLayout. If you use the BorderLayout, we will need to put the space-hungry component at the center. With GridBagLayout, we will need to set constraints for the component so that the fill=GridBagConstraints.BOTH. Or, if we do not mind every other component in the same container being as large as our space-hungry component, we can use a GridLayout.
  • Scenario: We need to display a few components in the compact row at their natural size. Consider using Panel to hold the components and using a Panel's default FlowLayout manager.
  • Scenario: We need to display few same-sized components in rows and/or the columns. GridLayout is perfect for this purpose. Use the Panel if it isnecessary to contain the components.

Drawing simple Shapes

Graphics class defines methods for drawing the following types of shapes:

  • Lines ( drawLine() )
  • Rectangles ( drawRect() & fillRect() )
  • Raised or lowered rectangles ( draw3DRect() and fill3DRect() )
  • Round-edged rectangles ( drawRoundRect() and fillRoundRect() )
  • Ovals ( drawOval() and fillOval())
  • Arcs ( drawArc() and fillArc() )
  • Polygons ( drawPolygon() and fillPolygon() )
Except for polygons and lines, all shapes are specified using their bounding rectangle. Once you understand rectangles, drawing other shapes is relatively easy. For this reason, this page will concentrate on rectangle drawing.

Be the first one to comment on this page.

  Java Tutorial eBooks
More Links » »
 Java Tutorial FAQs
More Links » »
 Java Tutorial Interview Questions
More Links » »
 Java Tutorial Articles
More Links » »
 Java Tutorial News
More Links » »
 Java Tutorial Jobs
More Links » »

Share And Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • blinkbits
  • BlinkList
  • blogmarks
  • co.mments
  • connotea
  • digg
  • Fark
  • feedmelinks
  • Furl
  • LinkaGoGo
  • Ma.gnolia
  • NewsVine
  • Netvouz
  • RawSugar
  • Reddit
  • scuttle
  • Shadows
  • Simpy
  • Smarking
  • Spurl
  • TailRank
  • Wists
  • YahooMyWeb


Keywords:introduction to java tutorial, java language, introduction to java programming, introduction to java a programming language

HTML Quizzes
CSS Quiz
CSS 1.0 Quiz
CSS 2.0 Quiz
XML Quizzes
XML Quiz
XSL Quiz
DTD Quiz
Schema Quiz
XForms Quiz
XLink Quiz
XQuery Quiz
XPath Quiz
XPointer Quiz
RDF Quiz
RSS Quiz
WAP Quiz
Web Services Quiz
Browser Scripting Quizzes
JavaScript Quiz
VBScript Quiz
WMLScript Quiz
E4X Quiz
Server Scripting Quizzes
ASP Quiz
SQL Quiz
ADO Quiz
CVS Quiz
Python Quiz
Apple Script Quiz
SQL Server Quiz
PHP Quiz
.NET (dotnet) Quizzes
Microsoft.Net Quiz
ASP.Net Quiz
.Net Mobile Quiz
C# : C Sharp Quiz
VC++ Quiz
Multimedia Quizzes
SVG Quiz
Flash Quiz
Media Quiz
Photoshop Quiz
Gimp Quiz
Matlab Quiz
Gnuplot Programming Quiz
GIF Animation Quiz
Scientific Visualization Quiz
Graphics Quiz
Web Building Quizzes
Web Browsers Quiz
Web Hosting Quiz
W3C Quiz
Web Building Quiz
Web Quality Quiz
Web Semantic Quiz
Web Careers Quiz
Weblogic Quiz
SEO Quiz
Web Site Hosting Quiz
Domain Name Quiz
Java Quizzes
Java Quiz
JSP Quiz
Servlets Quiz
Struts Quiz
EJB Quiz
JMS Quiz
JMX Quiz
Eclipse Quiz
J2ME Quiz
Programming Langauges Quizzes
C Quiz
C++ Quiz
Visual Basic Quiz
Data Structures Using C Quiz
Cobol Quiz
Assembly Language Quiz
Mainframe Quiz
Forth Programming Quiz
Lisp Programming Quiz
Pascal Quiz
Delphi Quiz
Fortran Quiz
OOPs Quiz
Data Warehousing Quiz
CGI Programming Quiz
Emacs Quiz
Gnome Quiz
ILU Quiz
Soft Skills Quizzes
Communication Skills Quiz
Time Management Quiz
Project Management Quiz
Team Work Quiz
Leadership Skills Quiz
Corporate Communication Quiz
Negotiation Skills Quiz
Database Quizzes
Oracle Quiz
MySQL Quiz
Operating System Quizzes
BSD Quiz
Symbian Quiz
Unix Quiz
Internet Quiz
IP-Masquerading Quiz
IPC Quiz
Software Testing Quizzes
Testing Quiz
Firewalls Quiz
SAP Module Quizzes
ERP Quiz
Business Warehousing Quiz
SAP Basis Quiz
Material Management Quiz
Sales & Distribution Quiz
Human Resource Quiz
Netweaver Quiz
Customer Relationship Management Quiz
Production and Planning Quiz
Networking Programming Quizzes
Corba Quiz
Networking Quiz
Microsoft Office Quizzes
Microsoft Word Quiz
Microsoft Outlook Quiz
Microsoft PowerPoint Quiz
Microsoft Publisher Quiz
Microsoft Excel Quiz
Microsoft Front Page Quiz
Microsoft InfoPath Quiz
Microsoft Access Quiz
Accounting Quizzes
Financial Accounting Quiz
Managerial Accounting Quiz
Testimonials | Contact Us | Link to Us | Site Map
Copyright ? 2008. Academic All rights reserved Privacy Policies | About Us
Our Portals : Academic Tutorials | Best eBooksworld | Beyond Stats | City Details | Interview Questions | Discussions World | Excellent Mobiles | Free Bangalore | Give Me The Code | Gog Logo | Indian Free Ads | Jobs Assist | New Interview Questions | One Stop FAQs | One Stop GATE | One Stop GRE | One Stop IAS | One Stop MBA | One Stop SAP | One Stop Testing | Webhosting in India | Dedicated Server in India | Sirf Dosti | Source Codes World | Tasty Food | Tech Archive | Testing Interview Questions | Tests World | The Galz | Top Masala | Vyom | Vyom eBooks | Vyom International | Vyom Links | Vyoms | Vyom World | Important Websites
Copyright ? 2003-2023 Vyom Technosoft Pvt. Ltd., All Rights Reserved.