answersLogoWhite

0

📱

Java Programming

The Java programming language was released in 1995 as a core component of the Java platform of Sun Microsystems. It is a general-purpose, class-based, object-oriented language that is widely used in application software and web applications.

5,203 Questions

Everything about the m-1 garand?

Scott Duff has a book that is very good.

Everything is a lot to ask for on the computer, so I suggest you follow the above advice and read the book, but here are a few highlights. Like most inventors, John Garand was somewhat eccentric. The Garand rifle was originally chambered for the .276 Pederson cartridge, but Doug MacArthur was Chief of Ordinance in the 30's and he decreed (wisely in my opinion) that all US rifle-caliber weapons be 30-06, reducing the M-1 Garand's capacity from ten to eight rounds. The M1903 sling was also compatible with the Garand, and the US ammo pouch accepted the 8-round Garand clips as easily as the 5-round M1903 clips. The M-1 Garand was adopted by the US Army in 1936 but produced in small numbers. In 1941 the Garand rifle beat the Johnson rifle and the M1903 as the USMC rifle. After the US entered the war, production could not keep up with demand, and an M-1 Garand was not in the hands of every American rifleman until 1943-44, although the M1903 continued for sniping and grenade-launching. The Germans had a semi-automatic rifle called the Gewehr 43 which was a good semi-automatic weapon, but simply was not as reliable and robust as the M1 (due to being made of crude parts and machining from mass supply shortages) nor was it as easly to produce or mantain in the field as the Garand rifle, so it was used mostly as a sniping rifle instead of a battle rifle, even then, it was very rare to encounter since it was never mass produced. The M-1 rifle fought again in Korea with the US and other armies, and it was replaced by the the M-14 in 1956. The US M-14 and the Italian BM59 are near-copies of the M-1 Garand in operation, but firing the smaller .308 Winchester cartridge.

Class hierarchy is a fundamental concept of object oriented programs explain what this term means with reference to inheritance abstraction and instantiation?

Class hierarchy is a term used in Java. It is used for identifying the inheritance hierarchy or the parent class relationships Ex: Public class B extends C { } Public class A extends B { } Here if we take the class hierarchy for class 'A' it would be A

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:

  1. Default or parameter-less constructor: A constructor which does not accept any arguments.
  2. Parametrized constructor: A constructor which accepts one or more arguments.

Similarly based on Access modifier also we have:

  1. Public constructor - Class can be instantiated by anyone
  2. Private constructor - Class cannot be instantiated by anyone
  3. Protected constructor - Class can be instantiated only by sub classes

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.

What is string array?

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?

In principle, values are always passed by reference (a copy of the value provided is copied onto the stack, the receiving method accesses this).
In the case of objects, this value is the memory address of an object. In other words, the object itself is not copied - only a copy of the address is made. Therefore, the receiving method works with the SAME object, and any changes will be reflected back to the calling program. The result is that, for all practical purposes, this works as if the object is passed by reference.

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.

What does exceptionally mean?

It is an adverb

Exceptionally- Something that is done well

She plays soccer exceptionally well.

What is the netbeans?

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-

  1. Abstraction
  2. Encapsulation
  3. Identity
  4. Modularity
  5. Hierarchy
  6. Typing
  7. Concurrency, and
  8. Persistence

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.

What is MUWebControl Class?

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