Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Spring Framework | Web Services | BioInformatics | Java Server Faces | Jboss 3.0 tutorial | Hibernate 3.0 | XML

Tutorial Categories: Ajax | Articles | JSP | Bioinformatics | Database | Free Books | Hibernate | J2EE | J2ME | Java | JavaScript | JDBC | JMS | Linux | MS Technology | PHP | RMI | Web-Services | Servlets | Struts | UML


 

Java Tutorials


 

 

Struts Tutorials

Struts Resources

Visit Forum! Post Questions!
Jobs At RoseIndia.net!

Java Master Java Applet

User Comments
Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl
  Blink   Furl   Simpy   Y! MyWeb 

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

5 comments so far (post your own) View All Comments Latest 10 Comments:

CSE111 Lab 8 – Exceptions, Applets, JavaFX and two IDEs

Task 1

Create an array of size 5. Try to store 100 to the index 21 of the array. It should give you a runtime error. Note the first line of the error that was given.

Task 2

In your main method, try to divide 1 by zero. Note the first line of the error that was given.

Task 3

import java.util.Scanner;
class Task3{
public static void main(String[]args){
Scanner sc=new Scanner(System.in);
int x,n=sc.nextInt();
int a[]=new int[n];

a[5]=99;
x=n/0;
}
}

Modify the program above to handle exception ‘ArithmeticException’ and ‘ArrayIndexOutOfBoundsException’ using try, catch and finally (to print a message “Final Line”) keywords.

Task 4

It is hard to know every error that may occur in advance. Hence, modify your solution to Task 3 to account for all other unknown errors that can be caused from any line of the main method. For example, 5.0 as input for the array size.

Task 5

Write a Java Application that will create your own exception ‘NotAnIntegerException’. There will be a method int readInteger( ). This method will take a String form the user. Then it will check if the number was ‘int’ or ‘float’ by checking presence of the decimal point in the input. It will throw an exception when a floating-point number is entered.


Task 6

Prepare an applet that prints hello world or your name.
Take help from: http://www.realapplets.com/
Rest will be shown in class

Task 7
Execute MSWord and Dr.Java from your java program
Help:
http://intekhabsadekin.wordpress.com/2009/03/05/java-runtimegetruntimeexec-will-and-will-not-work/

Task 8

Print hello world or your name using JavaFX

Task 9

Using Eclipse, Take 2 numbers as input, print the sum. See notes.

Task 10

Using NetBeans, Take 2 numbers as input, print the multiplication. See notes.

Notes for Task 9 and 10:
Show all screen shots including how to create project, write class, compile, run and test your program.

Posted by Nazmul on Tuesday, 03.16.10 @ 19:13pm | #95612

Name the method used to display any message in Applet?

Posted by Padma on Wednesday, 11.11.09 @ 19:15pm | #92497

this site is very very useful to us

Posted by vinod on Monday, 03.16.09 @ 08:29am | #85904

This is very useful site For Beginner and expert user. Thank you dear!!!

Posted by Ranjith on Wednesday, 02.18.09 @ 12:02pm | #84990

Thank You Very much, contents in this site were very useful to me in running a java appletcont

Posted by Keerthi on Thursday, 01.29.09 @ 21:16pm | #84299

Ask programming questions?

 

 

Back to Tutorial

 

  JDO Tutorials
  EAI Articles
  Struts Tutorials
  Java Tutorials
  Java Certification

Tell A Friend
Your Friend Name

 

 
Browse all Java Tutorials
Java JSP Struts Servlets Hibernate XML
Ajax JDBC EJB MySQL JavaScript JSF
Maven2 Tutorial JEE5 Tutorial Java Threading Tutorial Photoshop Tutorials Linux Technology
Technology Revolutions Eclipse Spring Tutorial Bioinformatics Tutorials Tools SQL
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2007. All rights reserved.