Can the run method be called directly to start a thread?
No. If you want to start a new thread of execution, you need to call the start() method of the thread.
Also, the run() is like any other java method and you can invoke it directly but if you do so, it would be called as part of the current programs thread and not as a new thread.
When the start() method is invoked, the JVM creates a new thread and automatically calls the run() method and that is why a new thread gets started and not by calling run() directly.
How many kinds of constructor in java?
Java has 2 types of constructors based on parameters passed:
Similarly based on Access modifier also we have:
What is the difference between for-loop container and foreach-loop container in ssis?
foreach loop executes a predetermined number of times eg. list of items, rows in a table, etc.
a for loop executes until a certain condition is met
Why goto in C language is called a jumping statement?
Because it forces the program sequence to go to another place in the program, just as if jumping across somewhere. This goto is found in most programming languages.
A string array is an array whose contents are strings.
An array is when you use a single variable names to store different data items. The data items are distinguished by a number (sometimes by more than one).
A string is a data type used to store texts. It may contain letters, digits, or other symbols.
A string array is an array whose contents are strings.
An array is when you use a single variable names to store different data items. The data items are distinguished by a number (sometimes by more than one).
A string is a data type used to store texts. It may contain letters, digits, or other symbols.
A string array is an array whose contents are strings.
An array is when you use a single variable names to store different data items. The data items are distinguished by a number (sometimes by more than one).
A string is a data type used to store texts. It may contain letters, digits, or other symbols.
A string array is an array whose contents are strings.
An array is when you use a single variable names to store different data items. The data items are distinguished by a number (sometimes by more than one).
A string is a data type used to store texts. It may contain letters, digits, or other symbols.
How can I add codec info to video files that weren't encoded properly?
I've got properly encoded AVI video files next to files with no information other than file size and length. Can I copy the a/v codec info from the good ones to the bad somehow? I can't open these with any editing or conversion software I've tried. Please help!
How pass by value and pass by reference work in Java explain with example?
What is a Javascript Void used for?
A Javascript Void can be used by a single computer programmer to evaluate a single command. It may also be used to purposely generate an undefined value.
What are the errors in object oriented program?
In Java, errors that arise during the execution of the program are more formally referred to as Exceptions. Exceptions can be handled using try catch blocks. Here is an example :
try {
int answer = 42 / 0 ;
} catch ( ArithmeticException e ) {
e.printStackTrace();
}
What is the library in java which does not need to be imported?
The java.lang package in Java is automatically imported for you.
It is an adverb
Exceptionally- Something that is done well
She plays soccer exceptionally well.
Net beans is A free, open-source Integrated Development Environment for software developers. You get all the tools you need to create professional desktop, enterprise, web, and mobile applications with the Java language, C/C++, and Ruby. NetBeans IDE is easy to install and use straight out of the box and runs on many platforms including Windows, Linux, Mac OS X and Solaris.
The NetBeans IDE 6.1 release provides several new features and enhancements, such as rich JavaScript editing features, support for using the Spring web framework, and tighter MySQL integration. This release also provides improved performance, especially faster startup (up to 40%), lower memory consumption and improved responsiveness while working with large projects.
For More information Checkout http://www.netbeans.org
Explain about type casting in java?
Type casting means explicitly converting one data type to another. For example, the following won't be allowed:
int a;
long b;
b = 5;
a = b;
In the last line, the compiler will complain, due to a possible data loss - long has a larger range. But if you believe that the conversion won't cause a problem in your program, you can override the error message with an explicit conversion (or typecast):
...
a = (int) b;
Type casting means explicitly converting one data type to another. For example, the following won't be allowed:
int a;
long b;
b = 5;
a = b;
In the last line, the compiler will complain, due to a possible data loss - long has a larger range. But if you believe that the conversion won't cause a problem in your program, you can override the error message with an explicit conversion (or typecast):
...
a = (int) b;
Type casting means explicitly converting one data type to another. For example, the following won't be allowed:
int a;
long b;
b = 5;
a = b;
In the last line, the compiler will complain, due to a possible data loss - long has a larger range. But if you believe that the conversion won't cause a problem in your program, you can override the error message with an explicit conversion (or typecast):
...
a = (int) b;
Type casting means explicitly converting one data type to another. For example, the following won't be allowed:
int a;
long b;
b = 5;
a = b;
In the last line, the compiler will complain, due to a possible data loss - long has a larger range. But if you believe that the conversion won't cause a problem in your program, you can override the error message with an explicit conversion (or typecast):
...
a = (int) b;
How constraints are implemented in object oriented systems?
Constraints, such as transaction throughput, response time, run-time platform, development environment, or programming language, are implemented, by using some specific principles of an object oriented systems, which are mentioned below-
How can sbt be used to build java code?
First of all, you have to start SBT while having java already in the JDK7 folder. You will need to specify Java Home as a command option. This changes the java version to the same one SBT uses.
What is the difference between a treeset and hashset in Java?
The difference between these two sets is simply the order/algorithm in which items are added to/accessed/removed from the map. The circumstances determine which particular implementation is better/faster.
A treeSet organizes data in a tree through use of Comparator (natural ordering) and the hashSet organizes data in a hash table (using a hash function).
See the Java API for more info:
http://www.j2ee.me/javase/6/docs/api/java/util/TreeSet.html
http://java.sun.com/javase/6/docs/api/java/util/HashSet.html
The previous answer (unless I'm mistaken) is pretty much completely wrong...
----------- Previous Answer ---------
In a treeset data are placed in order... while in a hashset data is randomly placed...
A treeset is more efficient in case of search element.
As hashSet use the hash function to store the values, it does not maintain the order of elements, but TreeSet maintains the natural odering of elements (you don't need to sort it).
Is there any project report on KBC in java?
Hi,
You can check this link http://javaadmin.com/kbc-project-in-java/
This is not a project report but a fully functional KBC project written in Java.
Thanks,
www.javaadmin.com
How do you get eclipse to put its output in a command line console window?
Any program you run in eclipse will direct standard output to the eclipse console window. If you want to run it in a cmd window (Windows) or a shell (*NIX), then you need to run the program yourself from outside of eclipse.
If you have a c in a class but got an A on a quiz then what's your final grade?
Your final grade would depend on how the teacher grades. For example, how many points is the quiz? How many points are possible for the semester? What are the weights for homework, quizzes, essays, and projects? The information you provide is not sufficient enough to answer the question. Your best bet would be to ask the teacher him/herself.
MUWebControl Class is an element of a Microsoft Web security process. It should not be removed from the hard drive but an anti-virus scan can be ran if it is suspected that it is not an authentic file.
Which numeric data type has storage capacity of 3 bytes?
For Microsoft SQL Server there are no numeric values that consume 3 bytes. The numeric data types, their value range, and byte consumption as we follows:
Data type
Range
Storage
bigint
-2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807)
8 Bytes
int
-2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)
4 Bytes
smallint
-2^15 (-32,768) to 2^15-1 (32,767)
2 Bytes
tinyint
0 to 255
1 Byte
What is the difference between JNDI and JDBC?
JDBC is java database API, while JNDI is java native directory API.
The main thing in here is that in a JNDI directory you're actually storing a JDBC DataSource, so, you're simply using JDBC and obtain a Connection via JNDI lookup.
In short words: JDBC is Database realm, JNDI lets you store Objects in a virtual context (the Directory) that can be local, remote (Implementation details usually don't matters).
You access this context via names, obtaining stored objects, is good to share things among different modules.
Application Servers usually have a JNDI Context for sharing global objects amon different application, Connection Poolers happen to be one of the most clear example of why sharing via JNDI is good. (Define 1 connection pooler, share between several webapps)
Explain different use of super with the help of java program?
the keyword super is used to access methods/variables of the parent class.
ex:
public class A {
public String getName(){
.....
}
}
public class B extends A {
public String getName(){
.....
}
}
If you want to access the method getName of class A inside class B you cannot do directly because the compiler would get confused. you need not create an object of A since it is already available. At this point you can use super
super.getName() is enough to call the method of the parent class
i means internet in Oracle 9i which means ready to use. Oracle 9i includes extensive features like high security, new caching facility and many more. In particular the application clusters of oracle 9i has the capacity of rapidly adding the nodes and disks.
What are Debugging tools and what are they used for in Java language?
Bugs are programming errors. Debugging tools are used to find the errors.
There are couple of more tools for debugging a java program :
1) jdb -- jdb stands for java debugger its command line tool which you can use to debug a java program. you need to start JVM with debug options though:
2) Eclipse - full fledged IDE which you can use for both local and remote debugging. I prefer this because its easy to setup and seamless and offer a lot in terms of debugginge.g. stack trace, value of variables, thread suspend and resume, evaluating expression at run time etc.
3) Netbeans - Another great Java IDE and very useful . similar to Eclipse.