From 6c966513e7ac8f64a4b05ca7c414563cb8010461 Mon Sep 17 00:00:00 2001 From: chandumopuri Date: Sat, 23 Jun 2018 14:59:38 +0530 Subject: [PATCH] raise an exception in thread --- .../bin/Abstraction/AbstractAnimal.class | Bin 1019 -> 1019 bytes .../{arraylist.java => hello.java} | 2 +- .../tecmax/methodExamples/swapingsring.java | 6 --- .../com/tecmax/methodExamples/swapstr.java | 19 ---------- .../com/tecmax/methodExamples/swapstring.java | 5 --- .../com/tecmax/methodExamples/thread2.java | 35 ++++++++++++++++++ 6 files changed, 36 insertions(+), 31 deletions(-) rename TecmaxPractise/src/com/tecmax/methodExamples/{arraylist.java => hello.java} (60%) delete mode 100644 TecmaxPractise/src/com/tecmax/methodExamples/swapingsring.java delete mode 100644 TecmaxPractise/src/com/tecmax/methodExamples/swapstr.java delete mode 100644 TecmaxPractise/src/com/tecmax/methodExamples/swapstring.java create mode 100644 TecmaxPractise/src/com/tecmax/methodExamples/thread2.java diff --git a/Android java/SoftGen/bin/Abstraction/AbstractAnimal.class b/Android java/SoftGen/bin/Abstraction/AbstractAnimal.class index c2d2e86d6a1cebb7e1d662b36c50e6e7ad6b1e6e..ef0c16ce2102e558099c0c1cb179f2493036e5e7 100644 GIT binary patch delta 61 zcmey({+oS+AQPJ^7Xvec&Sr6@a>mIAnZ=}xH!?6VFfnieNj3&XAj!zU4HjXT+|4Y> LWU^uMO=cwkYOD&a delta 61 zcmey({+oS+AQPJo7Xvec>Sl4Ka>mIAnZ=}xH!v_TFfnieNj3&XAj!zU4HjXT+|4Y> LWU_JcO=cwkYOo5e diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java b/TecmaxPractise/src/com/tecmax/methodExamples/hello.java similarity index 60% rename from TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java rename to TecmaxPractise/src/com/tecmax/methodExamples/hello.java index 0b0acd7..8817eee 100644 --- a/TecmaxPractise/src/com/tecmax/methodExamples/arraylist.java +++ b/TecmaxPractise/src/com/tecmax/methodExamples/hello.java @@ -1,5 +1,5 @@ package com.tecmax.methodExamples; -public class arraylist { +public class hello { } diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/swapingsring.java b/TecmaxPractise/src/com/tecmax/methodExamples/swapingsring.java deleted file mode 100644 index 1f6644a..0000000 --- a/TecmaxPractise/src/com/tecmax/methodExamples/swapingsring.java +++ /dev/null @@ -1,6 +0,0 @@ -package com.tecmax.methodExamples; - -public class swapingsring { - pub - -} diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/swapstr.java b/TecmaxPractise/src/com/tecmax/methodExamples/swapstr.java deleted file mode 100644 index f769787..0000000 --- a/TecmaxPractise/src/com/tecmax/methodExamples/swapstr.java +++ /dev/null @@ -1,19 +0,0 @@ -package com.tecmax.methodExamples; - -public class swapstr { - - public static void main(String[] args) { - // TODO Auto-generated method stub - String a="java"; - String b="programming"; - - a.concat(b); - b=a.substring(0, (a.length()-b.length())); - a=a.substring(b.length()); - System.out.println("value of a: "+a); - System.out.println("value of b: "+b); - - - } - -} diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/swapstring.java b/TecmaxPractise/src/com/tecmax/methodExamples/swapstring.java deleted file mode 100644 index 0a7b029..0000000 --- a/TecmaxPractise/src/com/tecmax/methodExamples/swapstring.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.tecmax.methodExamples; - -public class swapstring { - -} diff --git a/TecmaxPractise/src/com/tecmax/methodExamples/thread2.java b/TecmaxPractise/src/com/tecmax/methodExamples/thread2.java new file mode 100644 index 0000000..b007b81 --- /dev/null +++ b/TecmaxPractise/src/com/tecmax/methodExamples/thread2.java @@ -0,0 +1,35 @@ +package com.tecmax.methodExamples; + +public class thread2 extends Thread { + + public void run() + { + try + { + + System.out.println ("Thread " + + Thread.currentThread().getId() + + " is running"); + + } + catch (Exception e) + { + + System.out.println ("Exception is caught"); + } + } +} + + +public class thread3 +{ + public static void main(String[] args) + { + int n =8; + for (int i=0; i<8; i++) + { + thread2 object = new thread2(); + object.start(); + } + } +}