answersLogoWhite

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.

13,171 Questions
Computer Viruses
Java Programming
iPhone 3GS

How do you get rid of Java-ByteVerify?

== == == == == == This is not a virus, but rather a method to exploit a security vulnerability in the Microsoft Virtual Machine. First, update to the latest version of Java Runtime Environment (JRE) - 6 Update 3 (as of June 2008. # Click on Start> Control Panel and double click on Add/Remove Programs. Locate Java 2 Runtime Environment, SE v1.4.2and click on Change/Remove to uninstall it. # visit the SUN Java's website. http://java.sun.com/javase/downloads/index.jsp

# Scroll down to Java Runtime Environment (JRE) 6 Update 3. Click on Download. # Select Accept License Agreement. The page will refresh. # Click on Windows Offline Installation, Multi-language and save it to a convenient location. # Run this installation to update your Java. 2) Run a windows update

3) Do a complete scan with a fully updated Anti virus Program.

1.01k
Java Programming

Is java machine dependent?

Yes, since it can only play in some computers and not all computers can read it. Every Java application needs a minimum system configuration requirement which if not met, the machine will not be able to run Java.

Java the language itself is NOT machine dependent.

To run a program written in Java, it depends on an implementation of the Java Virtual Machine specification existing for a given machine/OS platform. Thus, a program written in Java can be run on any OS/machine platform for which a JVM has been created.

611612613
Technology
Bachelors Degrees
Graduate Degrees
Java Programming

Explain the usage of JPanel with example?

A JPanel is a container that is itself a JComponent. A JPanel can contain other components, and it can in turn be contained in another component. Several other classes, such as Box and TabbedPane, also define components that can be used as containers.

478479480
Math and Arithmetic
Java Programming
Temperature

Convert 70 degrees celsius to Fahrenheit?

Use this equation to convert degrees Celsius/Centigrade (ºC) to degrees Fahrenheit (ºF): (ºC x 1.8) + 32 =ºF

789
Web Programming
Java Programming

Write a java program to create a shopping bill?

import java.io.*;

class ShopReceipt

{

protected static void main()throws IOException

{

BufferedReader in=new BufferedReader(new InputStreamReader(System.in));

System.out.print("Enter the no. of types of Items Purchased: ");

byte z=Byte.parseByte(in.readLine());

String n[]=new String[z];

byte q[]=new byte[z];

float r[]=new float[z];

float pr[]=new float[z];

System.out.println("PLEASE ENTER::");

for(byte i=0;i<z;i++)

{

pr[i]=0;

System.out.print("Name of Item: ");

n[i]=in.readLine();

System.out.print("Rate of Item: ");

r[i]=Float.parseFloat(in.readLine());

System.out.print("Quantity of Items: ");

q[i]=Byte.parseByte(in.readLine());

pr[i]=r[i]*q[i];

}

double t=0;

for(byte i=0;i<z;i++)

t+=pr[i];

for(byte i=0;i<z;i++)

System.out.print("Item: "+n[i]+"\tQuantity: "+q[i]+"\tTotal Cost: "+pr[i]+"\n");

System.out.print("\nBill:"+t);

if(t>=100&&t<500)

System.out.print("\nGift::\nA Key Ring");

else if(t>=500&&t<1000)

System.out.print("\nGift::\nA Leather Purse");

else if(t>=1000)

System.out.print("\nGift::\nA Pocket Calculator");

}}

342343344
Java Programming
C Programming

What is the default return type of main?

'Main' is not at all associated with the return type. Specifying a function as main means that the function is to be executed first when the class is executed. A program can have only one 'main' function.

Answer:

The C standard ISO/IEC 9899 dictates that the return type of main() should be int.

Edited by Vijay Duggirala

It is void for Java. Which means that main in java returns no value.

341342343
Microsoft Windows
Java Programming
Numerical Analysis and Simulation
Python Programming

How do you code a program to find kaprekar number?

import java.io.*;

class kaprekar

{

public static void main(String args[])throws IOException

{

BufferedReader br=new BufferedReader(new InputStreamReader(System.in));

System.out.println("Enter any number");

int n=Integer.parseInt(br.readLine());

int t=n,count=0;

while(n!=0)

{

n=n/10;

count++;

}

int s=t*t;

int p=(int)Math.pow(10,count);

int ld=s%p;

int minus=s-ld;

int fd=minus/p;

int sum=fd+ld;

if(sum==t)

{

System.out.println("Kaprekar Number");

}

else

{

System.out.println("Not a Kaprekar number");

}

}

}

341342343
Java Programming
C Programming

What is an element in the Array?

An Array is a data type that stores multiple values in one variable. It can be thought of as a bunch of values that are related to one another and will be used together. Every value in the array is called an array element. They can be referred to or accessed by using their index position in the array.

339340341
Java Programming
Computer Programming

What are the advantages of platform independent programming languages?

A platform is a machine that interprets and executes code. Different platforms have different rules when interpreting code, as humans read different languages uniquely.

Platform independent programming languages are universal, and can execute on all major machines. Programmers may write one script and needn't worry about target machinery.

This is the sole advantage compared to platform dependent languages, which execute on a single machine. Unless a programmer would like the executable to work on one machine, additional work is necessary to bring it to other platforms.

333334335
Computer Programming
Java Programming
C Programming

Why are local variable stored on stack?

Because they are created and destroyed on 'last-in-first-out' principle.

327328329
Java Programming
How To

How to add a character to a string in java?

To add a Character to a string, simply use concatenation. When adding to strings, the + sign concatinates.

Example:

String one = "This is a strin";

one = one +'g';

/*OUTPUT :

This is a string

*/

Note, that if you intend to modify a string frequently, you should NOT be using the String class. The String object is intended for fixed strings which never (or, extremely rarely) change contents. If you have a string in your program which you intend to modify frequently, use the StringBuffer class instead. It operates in the same manner as String, but the underlying implementation is completely different, and is tuned for faster string manipulation operations.

327328329
Java Programming
C Programming
Electrostatics

What is static?

A atom consist out of 2 parts where as the centre is called the nucleus which is form out of Protons and neutrons and the outer part that orbits the nucleus is Electrons. Protons is positively charged, Electrons is negatively charged and neutrons well you guessed it, its neutral. When 2 or more objects that is not earth bound is in constant contact or rubbed against each other, the Electrons from one of the objects is transferred to the other object and thus that object has more Electrons than Protons and thus it has a negative charge and the other object has a positive charge as it has no more Protons than Electrons. Protons doesn't normally get transferred from object to object as it is normally held firm to the Atom. Opposite objects attract each other while the same charge repel each other but a neutral object will attract both positive and negative charged objects. When a charged object is in contact with a different charged object a discharge will take place and thus static electricity will take place.
Static menu: All patrons are offered the same foods every day. Once a static menu is developed and established, it rarely changes. Static menus are typically found in fast-food operations, ethnic restaurants, steakhouses and the like. Static menus can also be in institutional settings. For example, a static menu at an elementary school could offer students, along with vegetable and dessert, the same luncheon choices every school day: a cheeseburger, fish sticks, chicken tacos, pizza wedges or a sandwich.

317318319
Math and Arithmetic
Java Programming
C Programming

Why do we use double in java but do not use float?

Double is more precise than float. The 4 bytes saved on a float are usually not very relevant. However, if you need to save large amounts of numbers (e.g. in an array), and you don't need the extra precision, you might save some memory by using float.

308309310
Software and Applications (non-game)
Computer Programming
Java Programming
Computer Science

What are the names of any four procedural programming languages?

  1. ABC
  2. Ada
  3. Algol 60
  4. Algol 68
  5. APL
  6. Arc
  7. Assembly
  8. Awk
  9. BASIC
  10. Batch
  11. BCPL
  12. Befunge
  13. BETA
  14. C
  15. C++
  16. C--
  17. C# (pronounced C-sharp)
  18. CHILL
  19. Clipper
  20. Cobol
  21. CobolScript
  22. Component Pascal
  23. Cyclone
  24. D
  25. DATABUS
  26. Euphoria
  27. Forth
  28. Fortran
  29. Free Pascal
  30. GNU Pascal
  31. Icon
  32. IDL
  33. Jal
  34. JavaScript
  35. Jovial
  36. Lagoona
  37. Leda
  38. Limbo
  39. Lua
  40. m4
  41. Maple
  42. Mathematica
  43. MATLAB
  44. Modula-2
  45. Modula-3
  46. Mumps
  47. Oberon
  48. Objective Caml (OCaml)
  49. Occam
  50. Oz-Mozart
  51. Pascal
  52. Perl
  53. PHP
  54. PL
  55. PL/1
  56. Pliant
  57. PL/SQL
  58. PostScript
  59. PowerBuilder
  60. Proteus
  61. REBOL
  62. Rexx
  63. S-Lang
  64. Small C
  65. Snobol
  66. Tcl-Tk
  67. T3X
  68. VBA
  69. Visual Basic
  70. Visual DialogScript
  71. Yorick

Note: Some of these languages, such as PHP, Perl, Caml/OCaml, and IDL also support object oriented programming. Others on the list (C++, JavaScript, C# ) are primarily object-oriented languages which can also (though less commonly) be used to program procedurally.

Some are macro or scripting languages (Rexx, Awk, m4) which, while they do support some procedural concepts, aren't really procedural languages, but rather interpreted streams.

Also note that Assembly is NOT a high-level language, and generally is not considered a procedural language, as it doesn't have enough abstraction.

Finally, traditional COBOL is NOT a procedural language (in fact, one of the long-standing criticism of it is that it lacks any structured programming characteristics). Current-day COBOL has some ability to use procedural programming concepts, but, overall, should not be considered a real procedural language. SNOBOL is similar, in that the original version were certainly not procedural in nature, but modern versions are much more structured programming friendly (and can be considered a procedural language).

311312313
Java Programming

What is importance of static variable?

The static modifier tells the system that this particular variable belongs to the class and does not belong to any specific instance of the same. The class will contain only one instance of the static variable irrespective of how many objects of the class you create.

309310311
Java Programming

What is meant bu GUI in Java?

GUI stands for Graphical User Interface. The web browser in which you are viewing this website too can be considered a GUI

to know more abt java i found out this amazing channel on youtube. its called as SLIDENEARD. Its a channel dedicated to java programming issues.

i hope this helps your purpose.

309310311
Java Programming

Which data type in Java is the largest?

Among the primitive data types - float and double are the largest.

Data TypeBits UsedMinimum ValueMaximum Valuebyte8-2727 - 1short16-215215 -1int32-231231 -1long64-263263 -1float32n/an/adouble64n/an/a

309310311
Java Programming
C++ Programming

What is a sample of default constructor?

A default constructor is a constructor that takes no arguments.

Here's a sample:

class c

{

int a,b;

c() //Constructor 1

{

a=2;

b=1;

}

c(int x, int y) //Constructor 2

{

a=x;

b=y;

}

};

Here, Constructor 1 is called the default constructor, while Constructor 2 is a parameterized constructor.

309310311
Java Programming

Why java file name and public class name be same?

Because that is how Java file naming conventions are designed. The rules for naming files in Java are as follows:

• There can be only one public class per source file.

• Comments can appear at the beginning or end of any line in the source code file; they are independent of any of the positioning rules discussed here.

• If there is a public class in a file, the name of the file must match the name of the public class. For example, a class declared as public class Rock { } must be in a source code file named Rock.java.

• If the class is part of a package, the package statement must be the first line in the source code file, before any import statements that may be present.

• If there are import statements, they must go between the package statement (if there is one) and the class declaration. If there isn't a package statement, then the import statement(s) must be the first line(s) in the source code file. If there are no package or import statements, the class declaration must be the first line in the source code file.

• import and package statements apply to all classes within a source code file. In other words, there's no way to declare multiple classes in a file and have them in different packages, or use different imports.

• A file can have more than one nonpublic class.

• Files with no public classes can have a name that does not match any of the classes in the file.

305306307
Microsoft Windows
Java Programming
C Programming

What type of loop is the while loop?

It is also called as pretest loop.It executes the block of code after evaluation of condition in while statement.If evaluated answer is true,it will executes the block of code otherwise it will quit the loop.

306307308
Java Programming

What is reference data types in java?

A reference variable is used to refer to (or access) an object. A reference variable is declared to be of a specific type and that type can never be changed.

Ex:

ArrayList lst = new ArrayList();

The above line creates a reference variable lst which refers to an ArrayList object

305306307
Java Programming

What is the name of java interpreter?

That one is called "Java Virtual Machine".

299300301
Computer Programming
Java Programming

How class accomplish data hiding?

Data hiding is one of the important aspects of a class. Data hiding means to hide the members of the class and providing the access to only some of them. we can make the members of the class private or public. in private,the outside world cannot access those members which been made private.and rest we can make public.only the public members are accessed by the out side world and all the private members can be accessed using only the public members.in this way a class provides security to its data members.

309310311
Java Programming

What is class member in java?

A class has only two possible types of members: data members (variables) and member functions.

In the Java lexicography, class variables are called its Attributes, and all class functions are called Methods.

295296297
Java Programming

Is Two method cannot have same name in java?

Two methods can have the same name provided their signature is different.

Ex:

public int add(int a, int b){

...

}

public int add(int a, int b, int c){

...

}

This is allowed whereas

public int add(int a, int b){

...

}

public int add(int a, int b){

...

}

This is not.

The above only applies within a single Class or Interface definition.

It is entirely possible for different classes to have a method of the exact same signature (i.e. return value, method name, argument list). If a subclass has a method with the same signature as a parent class, then that method is said to have overridden the parent class's method. There is no specific name for the case where two unrelated classes have the same method signature, though that case is perfectly legal. Different signatures with the same method name are also allowed (which is called overloading when a subclass does it).

Interfaces follow the same rules and conventions as Classes in this matter.

-------------------

Two or more methods or constructor can have the same name provided they have different signature. In other words, when we can one of those methods, we should be able to tell which method was called even when they have the same name. You can read more about overloading constructors and methods on this page: http://www.javawithus.com/tutorial/overloading-constructors-and-methods

295296297

Copyright © 2020 Multiply Media, LLC. All Rights Reserved. The material on this site can not be reproduced, distributed, transmitted, cached or otherwise used, except with prior written permission of Multiply.