Tuesday, 25 December 2012

toString() method in java


What is toString() method? or define toString() method?

Returns a string representation of the object.
In general, the toString method returns a string that "textually represents" this object.
The result should be a concise but informative representation that is easy for a person to read. It is recommended that all subclasses override this method.


One of the standard methods defined in java.lang.Object is toString().


Syntax of toString() method?

public String toString()

Returns:

a string representation of the object.


How do you write your own toString methods?

toString() method example::

Monday, 24 December 2012

what is Apache ant tool?

what is ant tool?


Apache Ant is a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications. Ant supplies a number of built-in tasks allowing to compile, assemble, test and run Java applications. Ant can also be used effectively to build non Java applications, for instance C or C++ applications. More generally, Ant can be used to pilot any type of process which can be described in terms of targets and tasks.
Ant is written in Java. Users of Ant can develop their own "antlibs" containing Ant tasks and types, and are offered a large number of ready-made commercial or open-source "antlibs".
Ant is extremely flexible and does not impose coding conventions or directory layouts to the Java projects which adopt it as a build tool.

Thursday, 13 December 2012

Walk in on this weekend on 15-Dec-2012 (Saturday) in Noida





Dear All,

We have always appreciated the efforts you been putting in by referring the right candidate. We are looking forward your support in bringing in right associates.

We are announcing Walk in on this weekend on 15-Dec-2012 (Saturday) in Noida  for the following skills :

Skills
Experience
Joining Location
Interview  Location
HTML/CSS
4- 7  Years
Noida/ Pune
Noida
Android Developer
4- 7  Years
Noida
Noida
UI Designer
4- 7  Years
Noida
Noida
Mobility Architect
9+ Years
Noida/ Pune/ Bangalore
Noida

Please upload the resumes at EBS HR > Employee Self Service > Recruiting Activities > Refer a Buddy” by clicking on “Refer Buddy” button

For any queries, please drop a mail on helpdeskbuddy@techmahindra.com .

Link to Buddy process documents:


Please upload the CV on EBS and share the Buddy Applicant ID with your Buddy and invite them for the event.

Thanks,
Resource Management Group

Wednesday, 12 December 2012

java walkins on 15th dec 2012 and 16th Dec 2012

------------------------------------------------------------------------------------------------------------
DesignationSr. Java Developer- (drive on 15 th Dec 2012 Saturday in Hyderabad) )
Job DescriptionHi

We have openings for Java Developers for our company in Hyderabad and Chennai Locations.

Only Candidates who can be able to attend the F2F interview on 15th Dec 2012 Saturday can apply


Position; Sr. Developer

Location: Hyderabad/ Chennai

Exp: 4-7 yrs

NP: 60 days

Skill set:

  • Core java(OOPS, Swings, threading, Interfaces, Collections)
  • JavaJ2ee (JSP ,Servlets, EJB)
  • Struts/ spring/ Hibernate/ Web services

About Semantic :

SemanticSpace Technologies is a leading software services company that caters to diverse industry verticals. Founded in 1997, SemanticSpace's software engineers are providing solutions to enterprises across the globe. SemanticSpace's Technology Development Centers are located in Hyderabad, India, with sales offices across the USA to cater to its large clientele. With ISO 9001:2000 certified and SEI-CMMi Level 3 assessed company and excellent development teams, SemanticSpace has been successfully empowering its customers with innovative end-to-end technology solutions.
SemanticSpace's technology labs are built to provide Strategic Outsourcing services that include end-to-end product engineering services, enterprise solutions, packaged application implementation, QA & Testing services using popular tools & methodologies, and staff augmentation services. SemanticSpace leverages its enduring alliance with Microsoft as a Gold Certified partner while providing solutions to its customers. SemanticSpace specializes in developing strategic business solutions using its proven onsite-offshore delivery model - a stabilized project execution methodology using its homegrown tools PPM Studio (a collaborative, end-to-end, scalable, enterprise solution that helps in managing change from concept to delivery of a software project or solution) and QMWare (facilitates deploying high-quality applications quickly and effectively by better test management throughout the application testing cycle) to meet specific customer requirements.
SemanticSpace has consistently demonstrated its commitment to developing cost-effective, quality applications by adhering to strict time-lines. This has enabled SemanticSpace to work with some of the Fortune 200 / 500 / 1000 companies as their technology "Partner of Choice" on a continuous basis.
SemanticSpace is guided by a strong value system. These values nurture ethics empowerment, commitment and resilience and are practiced at every level. We provide "continuous value" to our customers through combination of mature processes, best practices and unique delivery models.
SemanticSpace as part of its growth strategy has recently acquired ARSIN Corporation, located in Silicon Valley. Arsin has a deep practice in SAP business process testing and markets a SAP regression test library and various other SAP testing solutions to reduce the time to solution. Arsin's solutions run around the globe at many Fortune 500 companies who are looking for a partner who sees enterprise software testing as a profound discipline in itself
For more information about the company please logon to www.semanticspace.com.

  Please revert with your updated CV with the following details.

Total exp:

Current CTC:

ExP CTC:

NP:

Date of Birth:

Reason for Change:

Current Location:

Preferred Location:

Available for drive(F2F Interview ):


Regards,
Sudheer
Talent Acquistion
Semanticspace
5th Floor, DHFLVC Silicon Towers, Kondapur, Hyderabad 500032
Work : 040- 39991581 l Cell : 9885911627 l sudheer_babu@semanticspace.com



A Global Provider of IBM, Microsoft and Testing Solutions
Award Winner for Technical Excellence, BPM, SOA, Portal and Governance


Desired ProfilePlease refer to the Job description above
Experience4 - 7 Years
Industry TypeIT Software, Software Services
RoleSoftware Developer
Functional AreaApplication Programming, Maintenance
EducationUG - Any Graduate - Any Specialization, Graduation Not Required
PG - Any PG Course - Any Specialization, Post Graduation Not Required
DOCTORATE - Any Doctorate - Any Specialization, Doctorate Not Required
LocationHyderabad / Secunderabad, Chennai
KeywordsCore javaJSPServletsCollectionsthreadingSpringStrutshibernateweb services
ContactSudheer K
Semantic Space
Survey # 14, 5th Floor Jayabheri Silicon Towers
Madhapur Road, Kondapur
HYDERABAD,Andhra Pradesh,India 500032
Telephone91-40-39991581
Websitehttp://www.semanticspace.com
-----@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@---------------------------------------------------------------------------------------

Corporate Overview:
Established in 1990, Persistent Systems (BSE & NSE: PERSISTENT) is a global company specializing in software product development services. For more than two decades, Persistent has been an innovation partner for the world’s largest technology brands, leading enterprises and pioneering start-ups. With a global team of 6,700+ employees, Persistent has 300+ customers spread across North America, Europe, and Asia. Today, Persistent focuses on developing best-in-class solutions in four key next-generation technology areas: Cloud Computing, Mobility, BI & Analytics, Collaboration across technology, telecommunications, life sciences, consumer packaged goods, banking & financial services and healthcare verticals
Job Description
Job Title: Java / J2EE experts
Designation
Module Lead/Team Lead/Tech Lead
Roles & Responsibilities
  • Experience in Core Java with J2EE along with at least any one of the following - Hibernate, Spring, Struts, EJBs, Web Services.
  • 3+ years of relevant Java / J2EE development experience.
  • Good in Computer fundamentals like Data structures, Algorithms etc.
  • Should have hands on development experience with STL, threads and processes, memory management.
  • Database experience in Oracle, DB2, MySQL or MS SQL Server is a must.
  • Strong communication & analytical skills.
Experience Required3.5 to 10 Years

Education
BE / B.Tech / ME / M.Tech in CS or other branches of engineering or Equivalent
Job Location
Pune/Nagpur/Hyderabad/Goa
Walk-in Interview Location: PUNE
Date:15th & 16th Dec 2012
Time: 10 AM to 3 PM
Venue:
Persistent Systems Limited.Aryabhata, 1st floor
Persistent Towers,
Plot No: 9A/12,CTS No: 12 A/12,
Erandwana, Near Padale Palace,
Pune-411004.

---------------------------------------------------------------------------------------------------------
Java - Developer/lead - Interview @ Chen & Bglr on 16th Dec_201135 - 20 Opening(s) in HCL
----------------------------------------------------------------------------------------------------------
Java developers walkin on Mahindra Satyam on 15th dec 2012

Walk-in DetailsDate-15th December, Starting Time: 10 AM
DesignationJava Developer - Walkin
Job DescriptionMust have good communication skills and willing to work in 2nd shift (2 pm 10.30 pm)

Strong knowledge of J2EE/Java, JSP, Struts Design Patterns

Knowledge in Oracle, SQL, XML, UNIX, WebSphere

Skill: Java/J2EE, JDBC, JSP, JSF, Struts (Mandatory)
Desired ProfileExperience: 3 to 7 years

Job Location: Chennai

Documents to be carried for the interview:

Latest resume

2 recent passport size photographs

PAN Card copy

Last three months Pay slips and Form 16 related to your experience

Walk in on Dec 15th 2012 (Saturday) at CHENNAI Location from 10.00 AM to 3.00 PM.
Interview Location:

Chennai

Chennai Mahindra Satyam Campus(CMSC)
SDB1 Building, No. 602/3, ELCOT SEZ
138, Sholinganallur Village
Tambaram Taluk, Kancheepuram District
Chennai.

Landmark : Near Global Hospital / Mhd Sathak Engineering College

Contact Person: Krithiga_Elumalai / Lakshmi Narashiman
Experience3 - 7 Years
Industry TypeIT Software, Software Services
RoleSoftware Developer
Functional AreaApplication Programming, Maintenance
EducationUG - Any Graduate
PG - Any PG Course
DOCTORATE - Doctorate Not Required
LocationChennai
KeywordsJava DeveloperJ2EEJavaJSPStruts DesignOracleSQLXMLUNIXWebSphere
ContactHR
Mahindra Satyam
MSat CAMPUS -CMSC
Satyam Computer Services Limited
No. 602/3, ELCOT SEZ 138, Sholinganallur Village, TambaramTaluk Kancheepuram
CHENNAI,Tamilnadu,India 600019
Websitehttp://www.mahindrasatyam.com



----------------------------------------------------------------------------------------------------------

We have openings for JAVA professionals! 

Experience: 3 years and above 
Skills: Experience in Core Java design and development. 
 Experience in J2EE, EJB, JSP, Servlets, XML, XSLT, Struts, Hibernate, Web services and Weblogic. 

All the candidates should have secured 60% & above in all of the following or 70% & above in any two of the following: 
Secondary, Higher Secondary (or its equivalent) and Graduation level (aggregate). 

Note: 

The candidates should carry the following documents: 
•Updated Resume 
•Passport size photograph 
•Last 3 months salary slips 
•6 months bank statements 
•Appointment Letter or appraisal letter (whichever is the latest) mentioning the salary structure 


The details for the walk in are as follows: 
Date: Saturday, 15-Dec-12 
Time: 9:30 AM to 12:30 PM 
Venue: Cybage Software Pvt. Ltd (a CMMI Level 5 Company), Cybage Tower1, Kalyani Nagar, Pune 
----------------------------------------------------------------------------------

Walk-in Interview for Core JAVA/J2EE - Sr.software Engineer/Project Leader at L&T Infotech- Chennai on 15th December 2012 (Saturday)

http://jobsearch.naukri.com/job-listings-Walk-in-Interview-for-Core-Java-j2ee-at-L-T-Infotech-Chennai-Larsen-Toubro-Infotech-Ltd--Chennai-3-to-8-121212003232?xz=1_3_5&xo=&xp=2&xid=135533348273020000&qp=java+j2ee&id=&f=-121212003232


Job Description:
  • Coding in Core JAVA/J2EE, Swing, JDBC, J2EE.HTML
  • JAVA / J2EE Patterns. XHTML, HTML/JAVASCRIPT, CSS. SOA, SOAP, XML, XSL, Web services.
  • Oracle, SQL, Database Knowledge. One or more of the following: Terracotta servers; BEA Web logic 5.1.0, IBM Web sphere 3.5. Inprise Application Server, Open EJB Application Server
  • Object Oriented Programming (OOP) concepts. Knowledge of UML using tools such as Visio and Rational Rose OOD, UML Design.Tomcat, VSS, SVN open source technologies Highly
Desired Skills
Jasper Reports, iReport. Installer scripting using Null soft

Experience: 3 to 8 years

Mandatory Skill: Core JAVA/J2EE, Swing, JDBC

Work Location: chennai

Contact Person: SasiKumar.A

Interview Date: 15th December 2012 (Saturday)
Timings: 9.00 am 11.00 am

If your profile is suitable for the above requirement please walk-in to L&T Infotech

Venue Details:
Larsen & Toubro Infotech Limited
TC-3, A- Block
L&T Infotech Park
Mount Poonamallee Road,
Manapakkam, Chennai-600 089
Near MIOT hospital or Chennai Trade centre

Mandatory Documents:
1) Passport Size Photograph
2) Updated Resume
3) Last 3 months pay slip
4) Recent Hike Letter

Thanks,
TA Team, Chennai
Salary:
Not Disclosed by Recruiter
Industry:
IT Software, Software Services
Functional Area:
Other
Role Category:
Programming & Design
Role:
Software Developer
Keyskills:

Desired Candidate Profile
Education:
(UG - Any Graduate - Any Specialization, Graduation Not Required) AND (PG - Any PG Course - Any Specialization, Post Graduation Not Required) AND ( Doctorate - Any Doctorate - Any Specialization, Doctorate Not Required)
Please refer to the Job description above

-------------------------------------------------------------------------------------------------------------------------------------------------------------------


Monday, 26 November 2012

what is the difference between j2ee j2se and j2me?

Question :  what is the difference between j2ee j2se and j2me?

Answer:  

J2SE is Java 2 Standard Edition: Consists of the core libraries basically all of the packages like java.lang, java.util, etc. This edition is the heart of Java and both J2EE and J2ME depend on J2SE.

J2EE is Java 2 for the Enterprise: Consists of the Enterprise APIs such as JMS, EJB, JSPs/Servlets and  JNDI.

Java 2 Micro Edition::  this edition is for programming Java on devices such as handhelds, cell phones, set top boxes, toasters, etc. J2ME can use *most* of J2SE but not necessarily all of the J2SE libraries.

threads in Java


Question:  How do Java threads make the environment asynchronous?

Answer:      The thread mechanism in Java begins with the main entrypoint thread the runtime environment creates to start a Java program. When you use that initial thread create secondary threads, each one runs independently of the other. The Java virtual machine manages the execution of the threads so they behave as if they all run at the same time, in fact each thread briefly takes turns at execution.
In its simplest form there may be no communication or synchronization between multiple threads in a Java program and they each run to completion independently of each other. In this respect Java threads are fundamentally asynchronous, there is no master clock that governs when threads will run and when they synchronize variables to “catch-up” with each other.
        It is often necessary and more useful if threads do check ready states before progressing, synchronize read and write access to shared variables and call-back to each other when their work is done. This is where thesynchronized keyword and the various sleep()wait() and notify()methods are used to more closely schedule the interaction between asynchronous threads.

Sunday, 25 November 2012

Errors on ANT Script

sloution to ANT build error "error during FTP transfer: j ava.net.ConnectException: Connection refused: connect"

This is my personal experience, when I am tying to  access the Unix server through FTP, I got the below error:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

C:\ant_scripting\apache-ant-1.8.2\build.xml:20: Could not create type ftp due to java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClientConfig at org.apache.tools.ant.taskdefs.optional.net.FTP$LanguageCode.getValidLanguageCodes(FTP.java:2693)
        at org.apache.tools.ant.taskdefs.optional.net.FTP$LanguageCode.(FTP.java:2689)
        at org.apache.tools.ant.taskdefs.optional.net.FTP.(FTP.java:135)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at org.apache.tools.ant.AntTypeDefinition.innerCreateAndSet(AntTypeDefinition.java:328)
        at org.apache.tools.ant.AntTypeDefinition.createAndSet(AntTypeDefinition.java:274)
        at org.apache.tools.ant.AntTypeDefinition.icreate(AntTypeDefinition.java:219)
        at org.apache.tools.ant.AntTypeDefinition.create(AntTypeDefinition.java:206)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:286)
        at org.apache.tools.ant.ComponentHelper.createComponent(ComponentHelper.java:264)
        at org.apache.tools.ant.UnknownElement.makeObject(UnknownElement.java:417)
        at org.apache.tools.ant.UnknownElement.maybeConfigure(UnknownElement.java:163)
        at org.apache.tools.ant.Task.perform(Task.java:347)
        at org.apache.tools.ant.Target.execute(Target.java:390)
        at org.apache.tools.ant.Target.performTasks(Target.java:411)
        at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
        at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
        at org.apache.tools.ant.Main.runBuild(Main.java:809)
        at org.apache.tools.ant.Main.startAnt(Main.java:217)
        at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
        at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
solution which I have find to avoid this error was given below:

1. To run FTP command  by using ant script, you must have to down load the commons-net-1.4.1.jar file.
  click here to down load the file, please make sure to download the jar file according to your JAVA version,
Find more details on the Apache  link.
2. please make sure to put the jar file in the class path. and run the script, oops you won't get any error now.

please put your comment in case of any issues.  

class path setting in java

Question: How to set classpath and path in java?
Answer:

This section explains how to use the PATH and CLASSPATH environment variables on Microsoft Windows, Solaris, and Linux. Consult the installation instructions included with your installation of the Java Development Kit (JDK) software bundle for current information.
After installing the software, the JDK directory will have the structure shown below.
JDK directory structure
The bin directory contains both the compiler and the launcher.

Update the PATH Environment Variable (Microsoft Windows)

You can run Java applications just fine without setting the PATH environment variable. Or, you can optionally set it as a convenience.
Set the PATH environment variable if you want to be able to conveniently run the executables (javac.exe, java.exe, javadoc.exe, and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:
C:\Java\jdk1.7.0\bin\javac MyClass.java
The PATH environment variable is a series of directories separated by semicolons (;). Microsoft Windows looks for programs in the PATH directories in order, from left to right. You should have only one bin directory for the JDK in the path at a time (those following the first are ignored), so if one is already present, you can update that particular entry.
The following is an example of a PATH environment variable:
C:\Java\jdk1.7.0\bin;C:\Windows\System32\;C:\Windows\;C:\Windows\System32\Wbem
It is useful to set the PATH environment variable permanently so it will persist after rebooting. To make a permanent change to the PATH variable, use the System icon in the Control Panel. The precise procedure varies depending on the version of Windows:

Windows XP
  1. Select Start, select Control Panel. double click System, and select the Advanced tab.
  2. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  3. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Windows Vista:
  1. From the desktop, right click the My Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced tab (Advanced system settings link in Vista).
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.
Windows 7:
  1. From the desktop, right click the Computer icon.
  2. Choose Properties from the context menu.
  3. Click the Advanced system settings link.
  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.
  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK.

Note: You may see a PATH environment variable similar to the following when editing it from the Control Panel:
%JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem
Variables enclosed in percentage signs (%) are existing environment variables. If one of these variables is listed in the Environment Variables window from the Control Panel (such as JAVA_HOME), then you can edit its value. If it does not appear, then it is a special environment variable that the operating system has defined. For example, SystemRoot is the location of the Microsoft Windows system folder. To obtain the value of a environment variable, enter the following at a command prompt. (This example obtains the value of the SystemRoot environment variable):
echo %SystemRoot%

Update the PATH Variable (Solaris and Linux)

You can run the JDK just fine without setting the PATH variable, or you can optionally set it as a convenience. However, you should set the path variable if you want to be able to run the executables (javac, java, javadoc, and so on) from any directory without having to type the full path of the command. If you do not set the PATH variable, you need to specify the full path to the executable every time you run it, such as:
% /usr/local/jdk1.7.0/bin/javac MyClass.java
To find out if the path is properly set, execute:
% java -version
This will print the version of the java tool, if it can find it. If the version is old or you get the error java: Command not found, then the path is not properly set.
To set the path permanently, set the path in your startup file.
For C shell (csh), edit the startup file (~/.cshrc):
set path=(/usr/local/jdk1.7.0/bin )
For bash, edit the startup file (~/.bashrc):
PATH=/usr/local/jdk1.7.0/bin:
export PATH
For ksh, the startup file is named by the environment variable, ENV. To set the path:
PATH=/usr/local/jdk1.7.0/bin:
export PATH
For sh, edit the profile file (~/.profile):
PATH=/usr/local/jdk1.7.0/bin:
export PATH
Then load the startup file and verify that the path is set by repeating the java command:
For C shell (csh):
% source ~/.cshrc
% java -version
For ksh, bash, or sh:
% . /.profile
% java -version

Checking the CLASSPATH variable (All platforms)

The CLASSPATH variable is one way to tell applications, including the JDK tools, where to look for user classes. (Classes that are part of the JRE, JDK platform, and extensions should be defined through other means, such as the bootstrap class path or the extensions directory.)
The preferred way to specify the class path is by using the -cp command line switch. This allows the CLASSPATH to be set individually for each application without affecting other applications. Setting the CLASSPATH can be tricky and should be performed with care.
The default value of the class path is ".", meaning that only the current directory is searched. Specifying either the CLASSPATH variable or the -cp command line switch overrides this value.
To check whether CLASSPATH is set on Microsoft Windows NT/2000/XP, execute the following:
C:> echo %CLASSPATH%
On Solaris or Linux, execute the following:
% echo $CLASSPATH
If CLASSPATH is not set you will get a CLASSPATH: Undefined variable error (Solaris or Linux) or simply %CLASSPATH% (Microsoft Windows NT/2000/XP).
To modify the CLASSPATH, use the same procedure you used for the PATH variable.
Class path wildcards allow you to include an entire directory of .jar files in the class path without explicitly naming them individually. For more information, including an explanation of class path wildcards, and a detailed description on how to clean up the CLASSPATH environment variable, see the Setting the Class Path technical note.

***************above data is from java documentation***************************

what is class in java with example?

Question:  what is class in java with example
Answer:     A class can be defined as a template/ blue print that describe the behaviors/states that object of its type support.

Declaring Classes::
You've seen classes defined in the following way:
class MyClass {
    // field, constructor, and 
    // method declarations
}
This is a class declaration. The class body (the area between the braces) contains all the code that provides for the life cycle of the objects created from the class: constructors for initializing new objects, declarations for the fields that provide the state of the class and its objects, and methods to implement the behavior of the class and its objects.
The preceding class declaration is a minimal one. It contains only those components of a class declaration that are required. You can provide more information about the class, such as the name of its superclass, whether it implements any interfaces, and so on, at the start of the class declaration. For example,
class MyClass extends MySuperClass implements YourInterface {
    // field, constructor, and
    // method declarations
}
means that MyClass is a subclass of MySuperClass and that it implements the YourInterface interface.
You can also add modifiers like public or private at the very beginning—so you can see that the opening line of a class declaration can become quite complicated. The modifiers public and private, which determine what other classes can access MyClass, are discussed later in this lesson. The lesson on interfaces and inheritance will explain how and why you would use the extends and implements keywords in a class declaration. For the moment you do not need to worry about these extra complications.
In general, class declarations can include these components, in order:
  1. Modifiers such as public, private, and a number of others that you will encounter later.
  2. The class name, with the initial letter capitalized by convention.
  3. The name of the class's parent (superclass), if any, preceded by the keyword extends. A class can only extend (subclass) one parent.
  4. A comma-separated list of interfaces implemented by the class, if any, preceded by the keyword implements. A class can implement more than one interface.
  5. The class body, surrounded by braces, {}.

Saturday, 24 November 2012

what is an object in java?

Ques: what is an object in java?
Ans :An object is an instance of a class. The relationship is such that many objects can be created using one class. Each object has its own data but its underlying structure (i.e., the type of data it stores, its behaviors) are defined by the class

Example:

consider we have a class Hello.java.

public class Hello
{
          }

to create an object for this class is:
 Hello helloObject = new Hello();

Here the helloObject is the object for that class.