BUY TELUGU TUTORIAL DVD'S:::: SEO::3500/-,DCA(DOS,WINDOWS,WORD,EXCEL,POWER POINT, MS ACCESS, INTERNET CONCEPTS)::499/-,DTP(PHOTOSHOP,PAGEMAKER, CORELDRAW,TELUGU TYPING)::999/-,C::700,C++::900,TALLY ERP 9:: 999,ORACLE:999/-,CORE JAVA::1000/-,SPOKEN HINDI:500,HTML::500/-,AUTOCAD::2500/-,DCA+DTP::1000/-,DCA+TALLY::1000,C,C++,JAVA::1500, ALL COURSES(DCA,DTP,C,C++,JAVA,ORACLE,TALLY,HTML,SPOKEN HINDI,AUTOCAD):: 3500/-..CONTACT : SYED HAFIZ, SHOPPING COMPLEX,8INCLINE COLONY,GODAVARI KHANI,KARIMNAGAR, TELANGANA,CELL:9395306603,EMAIL:COOLHAFI7@GMAIL.COM.
Home / Java / Learn java programming in telugu Part 3

Learn java programming in telugu Part 3

Learn java programming in telugu


An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following:

A user has entered invalid data.

A file that needs to be opened cannot be found.

A network connection has been lost in the middle of communications or the JVM has run out of memory.

Some of these exceptions are caused by user error, others by programmer error, and others by physical resources that have failed in some manner.

You can see we have the package name first. Notice how the line ends with a semicolon. If you miss the semicolon out, the programme won’t compile:

package firstproject;

The class name comes next:

public class FirstProject {

}

You can think of a class as a code segment. But you have to tell Java where code segments start and end. You do this with curly brackets. The start of a code segment is done with a left curly bracket { and is ended with a right curly bracket }. Anything inside of the left and right curly brackets belong to that code segment.

What’s inside of the left and right curly brackets for the class is another code segment. This one:

public static void main( String[ ] args ) {

}

The word “main” is the important part here. Whenever a Java programme starts, it looks for a method called main. (A method is just a chunk of code. You’ll learn more about these later.) It then executes any code within the curly brackets for main. You’ll get error messages if you don’t have a main method in your Java programmes. But as its name suggest, it is the main entry point for your programmes.

The blue parts before the word “main” can be ignored for now.

(If you’re curious, however, public means that the method can be seen outside of this class; static means that you don’t have to create a new object; and void means it doesn’t return a value – it just gets on with it. The parts between the round brackets of main are something called command line arguments. Don’t worry if you don’t understand any of that, though.)

The important point to remember is that we have a class called FirstProject. This class contains a method called main. The two have their own sets of curly brackets. But the main chunk of code belongs to the class FirstProject.

About Hafiz

Leave a Reply

Your email address will not be published. Required fields are marked *

STATE BANK OF HYDERABAD, ***NAME:Hafiz SD, BRANCH:JALLARAM, ACCOUNT.NO:62041435239, IFSC CODE:SBHY0020609,****, ANDRA BANK*** NAME:SYED HAFEEZ BABA, BRANCH:8INCLINE COLONY, ACCOUNT.NO:116710100037533****SBI****NAME:SYED HAFEEZ BABA,ACCOUNT NO:35321924009,IFSC CODE:SBIN0013338,BRANCH:GODAVARIKHANI.,...