Home Tutorialhelp Comment SCJP Problem

 
 

Comment

Preetika
SCJP Problem,
April 21, 2009 at 11:16 AM

7. waitForSignal(){
8. object obj=new object();
9. synchronized (Thread currentThread()){
10.obj.wait();
11.obj.notify();
12.}
13.}
Which statement is true?

A.Code may throw an InterruptedException.
B.Code may throw an IllegalStateException.
C.Code may throw a TimeOutException after 10 minutes.
D.This code will not compile.
View All Comments | View Tutorial
Advertisement
Related Tutorial and Articles
Java Beginners

java thread problem - Java Beginners
java thread problem  Hi Friends, My problem is related with java.util.concurrent.ThreadPoolExecutor I have a thread pool which using.... Please help me Thanks in advance Sushil  Hi friend, I 

Java Beginners

SCJP - Java Beginners
SCJP  Need help for SCJP Exam preparation 

Java Beginners

JAVA THREAD - Java Beginners
JAVA THREAD  hii i wrote a pgm to print the numbers from 0 to 9 in 2 threads. but it couldn't work pls help me int it. the code is given below...); } public void fgh(int i,int p) { int sum; new Thread(public void run 

General

T - Java Terms
T - Java Terms       Java Thread A java thread is an execution context.... Programmer may use java thread mechanism to execute multiple tasks at the same time 

Java Beginners

thread inside other thread - Java Beginners
thread inside other thread  Hello, can you help me please: I want... send msg2 he will connect with another server by create new thread that use different socket and different input and output stream the problem is in closing 

Java Beginners

Thread
Thread  Explain two ways of creating thread in java. Explain at three methods of thread class.   Java Create Thread There are two main ways of creating a thread. The first is to extend the Thread class and the second 

Java Beginners

Thread
Thread  What is multi-threading? Explain different states of a thread.   Java Multithreading Multithreading is a technique that allows... processor system. States of Thread: New state ? After the creations of Thread 

Programming Tutorials

Thread in java
Overview of Threads Threading in Java Thread Creation...A thread is a lightweight process which exist within a program and executed... with a single process. Thus a process that has only one thread is referred 

Java Beginners

help please!!! T_T
help please!!! T_T  what is wrong in this?: import java.io.*; class InputName static InputStreamReader reader= new InputStreamReader(system.in); static BufferedReader input= new BufferedReader (reader); public static void main 

Java Beginners

Thread
Thread  Write a Java program to create three theads. Each thread should produce the sum of 1 to 10, 11 to 20 and 21to 30 respectively. Main thread....   Java Thread Example class ThreadExample{ static int 

Java Beginners

how to destroy java thread
how to destroy java thread  how to destroy java thread?   This will help .. Shutting Down the Java Thread 

Development process Questions

Java Thread Synchronization - Development process
Java Thread Synchronization  Hi,Please help me with this coding. I... press any key on the keyboard,then one thread must stop.When I press the keys second time,then the second thread must stop. Please provide me with the code   

Java Server Faces Questions

t:selectOneMenu - Java Server Faces Questions
select One Menu  Hi, I wanted to create a menu to select or choose from ..for my home page.Can anyone please help?Thanks in Advance.  Hi friendRead for more information,http://www.roseindia.net/jsf/selectOneMenu.shtml 

General

SCJP Module-8 Question-1
; public static void main(String[] args) { 6    Thread t = new Thread 

Java Beginners

Java Thread - Java Beginners
of a thread.. pls help me in this trouble...  Hi friend, Following... and simple examples of "Multithreading". 1. http://www.roseindia.net/java/thread/index.shtml 2. http://www.roseindia.net/java/thread 

Java Beginners

Thread
Thread  Explain the use of throw and throws keywords.   Java throw and throws Whenever we want to force an exception then we use throw... a possible exception then we use throws keyword. Point to note here is that the Java 

Java Server Faces Questions

thread inside other thread - Java Server Faces Questions
thread inside other thread  Expert:I Hello, can you help me please... and when he send msg2 he will connect with another server by create new thread that use different socket and different input and output stream the problem 

Java Interview Questions

SCJP - Java Interview Questions
SCJP  i need scjp 5.0 dump 

Java Interview Questions

java thread program
java thread program  write a java program to find out all the current running thread in a java program   public class RunningThreads...); for (int i=0; i<count; i++) { Thread t = threads[i 

JSP Interview Questions

java thread program
java thread program  write a java program to find out the current running thread in a java program   public class RunningThreads{ public...); for (int i=0; i<count; i++) { Thread t = threads[i 

Java Beginners

scjp 310-065 - Java Beginners
scjp 310-065  can you post me (scjp 310-065) successfull dump. its very urgent. because my scjp paper is very near. thank you 

JSP Servlet Questions

Java Thread not geting Connection pool - JSP-Servlet
Java Thread not geting Connection pool  Hi All, Please help me in following problem. I have database connection on server using connection pool... from browser. To execute that process I have used Thread. But there is an problem 

Java Beginners

thread dump
thread dump  Hi, I wanted to understand the Locked/waiting state below in the java thread dump. Is it normal to have waiting on locked object... help clarify on how to interpret these values waiting on <0x701dd1e0> 

JavaMail Questions

Exception in thread
Exception in thread   Hi, I have created a java file for sending... properly. But am unable to run this file using java command on command prompt. javac... but when i am trying to run following command I am getting an error. java -cp D 

Java Beginners

java Thread
java Thread  what is purpose of Thread 

Java-Tutorials

Thread Deadlocks - Java Tutorials
Thread Deadlock Detection in Java Thread deadlock relates to the multitasking...() { Thread.currentThread().setName("MainThread"); Thread t = new Thread(this, ".... Lock Timeout If a thread doesn't succeed in taking all the necessary locks 

Java Interview Questions

problem
problem  hi'sir mai niit student hu.mujhe java ka program samaj me nhi aata mai kya karu and mai kaise study karu please help me.   Learn Java from the given link: Java Tutorials 

JDBC Questions

Exception in thread "main" java.lang.ClassCastException
. Anyone help me please. Java Code: import java.sql.*; import org.postgis....Exception in thread "main" java.lang.ClassCastException  I am trying..._jdbc.java:37:error:package org.postgresql doesnot exist can anyone solve this problem 

Java Beginners

Exception in thread "main" java.lang.ClassCastException
. Anyone help me please. Java Code: import java.sql.; import org.postgis....Exception in thread "main" java.lang.ClassCastException  I am trying...:error:package org.postgresql doesnot exist can anyone solve this problem its 

Java Interview Questions

Java thread
Java thread  How can a dead thread be restarted?  A dead thread cannot be restarted 

Java Beginners

Thread in java
Thread in java  which method will defined in thread class 

Java Interview Questions

Java thread
Java thread  What are the high-level thread states 

Java Interview Questions

Java thread
Java thread  What are the ways in which you can instantiate a thread 

Java Interview Questions

Java thread
Java thread  What is the difference between process and thread 

Java Interview Questions

Java thread
Java thread  What invokes a thread's run() method 

Java Interview Questions

Java thread
Java thread  What's the difference between a thread's start() and run() methods 

Java Beginners

SCJP - Java Beginners
SCJP  I want to take SCJP certification exam. But i don't know that which when i should take i mean SCJP 5 or 6 ? Please let me know, which one will be benificial 

General

SCJP Module-4 Question-7
the 'Twin' method in "Subexample7" doesn't have " 

General

SCJP Module-2 Question-3
. 3.Unresolved compilation problem. 4.a=2 or a=1 or i >2.5 Value of i =null Answer 

General

SCJP Module-8 Question-2
the correct option: (A) Runnable r = new Runnable(); and Thread t = new Thread(r); (B) Runnable r = new Thread(); and Thread t = new Thread(r); (C) Runnable r = new Test(); and Thread t = new Thread(r); (D) Runnable r = new Test(); and Thread 

Java Beginners

help
Java application  public int remainder(int a, int b) { int answer = a % b; System.out.printf("%d % %d = ", a , b... running it, it tells me:- Exception in thread "main 

Java Interview Questions

Java thread
Java thread  Why do threads block on I/O?   When a thread... and in that time some other thread which is not waiting for that IO gets a chance to execute.If any input is not available to the thread which got suspended for IO 

Java Beginners

java implementation problem
java implementation problem   I want to implement following in java code : Main thread Create three threads wait for completion of stage 2 of all... thread Acess all three local variable (LC'0, LC'1, LC'2) Each threads 

Java-Tutorials

Java :Thread dumpStack
Java :Thread dumpStack In this tutorial you will learn about Java Thread dumpStack . Thread dumpStack : JVM gives the concept of Thread Dump which... are created. When you create any thread ,it doesn't mean that it is actually 

Java-Tutorials

Java Thread Interrupted
Java Thread Interrupted In this tutorial, you will learn how to interrupt a thread with example in Java. Thread Interrupt : Java thread facilitate you... thread can't modify. public static boolean interrupted() : This method 

JavaScript Questions

help
by this formula: Total Payment = T‚?? T*(D/100) where T is the total purchase.... Based on the above scenario, write a complete Java program. Your program should 

General

SCJP Module-8 Question-9
Given a sample code: public class Test implements Runnable { public static void main(String[] args) throws Exception { Thread t = new Thread(new Test()); t.start(); System.out.print(" Started"); t.join(); System.out.print 

Java Beginners

Java implementation problem
/answers/viewqa/Java-Beginners/28578-java-implementation-problem-.html...Java implementation problem  I want to implement following in java code : Main thread 1. create three threads 2. wait for completion of stage 2 

Java-Tutorials

Java :Thread Methods
Java :Thread Methods This section explains methods of Thread class. Thread Methods : Thread class provides many method to handle different thread... getName() - t returns name of the current thread. int getPriority 

General

SCJP Module-8 Question-10
Given a sample code: class Test extends Thread { public void run() { System.out.println("One"); System.out.println("Two"... void main(String args[]) { Test t = new Test(); t.method(); t.start 

Java Interview Questions

help
(); } } SFDV2103 ‚?? Java Programming Fall, 2012 Term Project..., you are asked to make changes in the existing class. Problem: Open the class ‚... on the percentage of cheating. SFDV2103 ‚?? Java Programming Fall, 2012 Term 

Java-Tutorials

What Is Thread In Java?
What Is Thread In Java? In this section we will read about thread in Java... execution and the description of the example. Before, defining a Thread in Java..., process with multiple thread is called Multi-threaded process. Thread In Java 

Java Beginners

plz help - Java Beginners
Thread in java : First Code : import java.io.PrintWriter; import...; import java.io.*; class MyThread1 implements Runnable{ Thread t...; MyThread1(String s1){ s=s1; t=new Thread(this); t.start 

General

SCJP Module-8 Question-3
Given a sample code: public class Test extends Thread { static String name = "raj"; public static void main(String args[]) { Test t = new Test(); t.testMethod(name); System.out.print(" " + name); } public 

Java-Tutorials

Thread Synchronization in Java
Thread Synchronization in Java Sometimes, when two or more threads need shared...; Thread t; public PrintCaller(Print targ, String s) { target = targ; msg = s; t = new Thread(this); t.start(); } // synchronize calls to call 

Java Beginners

Help with cypher and key problem in Java - Java Beginners
Help with cypher and key problem in Java  So far I have a program that asks a user for a message and a key amount and displays an encrypted message which is obtained by shifting the each character according to the key amount 

Java-Tutorials

Java Thread destroy
Java Thread destroy In this tutorial, we are using Thread.destroy() method to destroy the thread. Thread destroy() : Thread class provides destroy method to destroy the thread. In general, Thread.destroy() is dangerous 

Java-Tutorials

Java Thread : stop() method
Java Thread : stop() method In this section we are going to describe stop() method with example in java thread. stop() method : Java thread provides method stop to stop any running thread. It is deprecated  as it causes 

General

SCJP Module-8 Question-6
Given a sample code: 1    public class Test extends Thread... { 3    Test t = new Test(); 4    t.start(); 5 ... and this will start the thread but just after the start method the method 

Hibernate Interview Questions

Java thread
Java thread  What is the use of serializable 

Java Beginners

Java problem - Java Beginners
Java problem  what are threads in java. what are there usage. a simple thread program in java  Hi Friend, Please visit the following link: http://www.roseindia.net/java/thread/index.shtml Thanks 

Java Interview Questions

Java thread
Java thread  What method must be implemented by all threads 

Java Interview Questions

Java thread
Java thread  What is the difference between wait() and sleep method 

Java-Tutorials

Java :Thread Synchronization
Java :Thread Synchronization This section explains how to use concept of synchronization in java Thread. Thread Synchronization : . Java supports multi... this problem java provides concept of Synchronization. There are two way to use 

General

SCJP Module-8 Question-7
Given a sample code: public class Test implements Runnable { public void run() { System.out.print("run"); } public static void main(String[] args) { Runnable r = new Test(); Thread t = new Thread(r); t.run(); t.start 

Java-Tutorials

Thread Creation
; In Java, an object of the Thread class can represent a thread. Thread... RunThread.java C:\j2se6\thread>java RunThread Thread...;   t=new Thread(this);   t.start();   }   

Java Interview Questions

Java thread
Java thread  Can we have run() method directly without start() method in threads 

Java Beginners

CREATE AND WRITE FILE THREAD JAVA
CREATE AND WRITE FILE THREAD JAVA  Hi guys I was wondering how can I make this program in java with threads. I need to create a file and write... send until reaches an specific size Im kind LOST GUYS! I need help Im 

Java Beginners

please help me to overcome this problem
please help me to overcome this problem  how to make it easy to write java code. can u please give me suggestions 

JSP Servlet Questions

java Problem
java Problem  I want to create a binary tree for displaying members in Downline. i am creating a site for MLM(Multi-Level MArketing). tree must be dynamically populated from database. is there any help for me. Thanks in advance 

Java Interview Questions

Java Thread and Runnable
Java Thread and Runnable  What's the difference between Thread and Runnable types 

Java Interview Questions

Java thread state
Java thread state  what is Static binding 

General

SCJP Module-2 Question-1
 

Java Beginners

Thread - Java Beginners
the concept of thread, thread creation and use of threads in JAVA application?  Thread creation and use of threads in JAVA Java Resourcehttp://www.roseindia.net/java/thread/thread-creation.shtml 

General

SCJP Module-2 Question-20
will be : Exception in thread "main" java.lang.Error: Unresolved compilation problem: Type mismatch: cannot convert from int to boolean 

Java Beginners

How to Differenciate Main Thread and Child Thread in Java
Main Thread and Java Child Thread. Please Suggest any example or online link... in Java Programming Language. These are Java Main Thread and the Child Thread. The Below reference will provides you clear idea of java thread concept. http 

Java Beginners

closing thread for jdk1.5 or higher versions - Java Beginners
closing thread for jdk1.5 or higher versions  Hi All, I am using jdk1.5 and higher version of java. I tried to destroy thread by using... in thread "main" java.lang.NoSuchMethodError how can i destroy the thread and how 

Java Interview Questions

Java thread lock
Java thread lock  What happens when a thread cannot acquire a lock on an object 

Java-Tutorials

Java Thread checkAccess
Java Thread checkAccess In this tutorial you will learn how to check permission of thread modification by using checkAccess () method. Thread checkAccess... if the current thread don't have permission to access the thread. Example 

Java3D Questions

java help
java help  Design and implement a class called DateWriter that has three instance variables: a string for month, an integer for day, and an integer.... It doesn‚??t change the value of the year instance variable. 5) A method called 

Java Interview Questions

Java thread state
Java thread state  Difference between sleep and suspend 

Java Interview Questions

Java thread state
Java thread state  What is the difference between yielding and sleeping 

General

Java Thread
Java Thread Tutorials In this tutorial we will learn java Threads in detail. The Java Thread class helps the programmer to develop the threaded application in Java. Thread is simple path of execution of a program. The Java Virtual Machine 

Java Beginners

Thread
t; String s; MyThread(String s1) { s=s1; t=new Thread... to the thread constructor eventhough we had created only one thread and if you say we have added to point to the current thread then why we have not added 

Programming Tutorials

Sun Certified Java Professional (SCJP)
Sun Microsystem offers SCJP certification exams in two versions SCJP 5 CX-310-055 and SCJP 6 CX-310-065 certification exams in which SCJP 6 CX-310-065 certification examination is the latest version. For qualifying SCJP 5 CX-310-055 

Java-Tutorials

Java Thread
Java Thread In this tutorial we will discuss about Java Thread. Java Thread : A thread is light weight java program.JVM permits you to have multiple threads for concurrent execution. Each thread has priority. You can also set 

Java Beginners

thread - Java Beginners
thread  can i asko for programs in thread method that will allow user to input two separate names  Hi friend, For more information on Thread visit to : http://www.roseindia.net/java/thread/index.shtml Thanks 

Java-Tutorials

Create Thread by Extending Thread
Create Thread by Extending Thread This section explain how to create thread by extending Thread class in java. Extending Thread : You can create thread by extending Thread class and then by creating instance of that class you can 

Java Interview Questions

Thread scheduling
Thread scheduling  What is the algorithm used in Thread scheduling?  Java uses fixed-priority scheduling algorithms to decide which thread... is started, Java makes the lower priority thread wait if more than one thread exists 

Java Beginners

Thread
=" + i); } public static void main(string args[]) { A a = new A(); Thread t...[]) { A a = new A(); Thread t = new Thread(a); t.start...Thread  will this code work..? class A extends Thread { public 

Java Beginners

Daemon thread - Java Beginners
information, visit the following link: http://www.roseindia.net/java/thread...Daemon thread  Hi, What is a daemon thread? Please provide me... thread which run in background. like garbadge collection thread. Thanks  

Java Beginners

Demon thread
Demon thread  What is demon thread? why we need Demon thread?  ... there are daemon thread by killing them abruptly.Any thread can be a daemon thread. For more information, visit the following link: http://www.roseindia.net/java 

General

SCJP Module-1 Question-5
 

Java Beginners

java help - Java Beginners
java help  Code a try statement that catches an IOException and an EOFException. If an IOException occurs, print the message ?An I/O error occurred....? to the console. You don?t need to code anything within the try block 

Java Beginners

Java problem - Java Beginners
Java problem  I have an image in my application and I need to restrict the image path view on the browser. Noone should be able to right click and see the image path. Please help 

Java Beginners

Thread concept
t; String name; Newthread3(String threadname){ name=threadname; t=new Thread(this,name); System.out.println("New thread: "+t); t.start(); } public void run...Thread concept  Everytime when i run a multithread program it gives 

Java Beginners

java thread - Java Beginners
Java Thread  What is thread in Java? and how can i write a Java thread program?Thanks in advance!!  Hi friend,import javax.swing.*;import...(a); } private JPanel canvas;}class Ball extends Thread { public Ball(JPanel 

General

Java Thread
Java Thread       A java... sequential flow of control within a program. Programmer may use java thread mechanism...:/www.roseindia.net/java/thread/index.shtml 

Java Beginners

java thread - Java Beginners
java thread  PROJECT WORK: Create a application using thread to implement the application. The application should consist of the following classes... . AccountManager.java The AccountManager class demonstrates creation of Thread objects using 

Java Beginners

Extending thread - Java Beginners
visit to : http://www.roseindia.net/java/thread/index.shtml Thanks...Extending thread  what is a thread & give me the programm of exeucte the thread   Hi friend, Thread : A thread is a lightweight 

Advertisements Advertisements
 

 

 

DMCA.com