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.
Parent Category: Computer Programming

Questions in Java Programming

Answer The Carnegie system awards 1 credit per 50 or 55 minute class session per week over the course of a semester. I assume the statement means there is more (or less) class time required for the programming courses. It may be that the courses are "stacked" or offered in another alternative de…
Popularity: 214
In general, people will work harder when there are other people doing the same thing next to them. And with an instructor giving you every move. If you do it on your own, you are more likely not to work as hard or do as many reps. It's just the way most people are. A class also give you moves you ma…
Popularity: 161
Answer I have had this same problem about 6 years out of the 18 I have had this pool. If the bugs are little guys that look like a simple, long, black bug, with 1 wing or fin on each side. Every time you pick them up with a skimmer, they jump back in the pool and swim around. I have seen…
Popularity: 91
Answer I think the reason this question has gone unanswered is it is not clear on what you want to do. So I'm going to guess that you want to duplicate a image changing sequence that you have on your desktop and put it on a website. If this is the case then this script will do just that. In t…
Popularity: 131
Answer As an "F" that averages into (and brings down) your GPA, just the same as any other grade. See what your college's rules and procedures are for taking the class over again. Some colleges count both grades and your net grade for the course is the average of the two of them. Others let the m…
Popularity: 164
Answer 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/Remo…
Popularity: 1007
Answer You are talking about the implementation point view of Abstract class and the interface. Let's go. 1. Interface helps Multiple inheritance:- In java you can't have a class inherited from more than one class, i.e. the multiple inheritance. Interface helps us in implementing the multiple …
Popularity: 105
There could be a exception which cannot reach the user as it looks, instead it could be replaced by some other exceptions. In this case, the only solutions is to write our own exception and show the details regarding that exception. Exceptions could be thrown inside a Web Service for various reason…
Popularity: 273
sometimes there are situations where the program is vary long which can make error debugging a long process so java provides a facility to make user defined exception handling suppose we are dividing two numbers a/b and if the user enters the value of b 0, the user wants to display an error of your …
Popularity: 87
Answer Java uses a code-compiler, which does not create a machine-code, like normal Windows programs, but a byte-code, which the Java interpreter runs. It is like a mini-operating system, forming a layer between the operating system and the program code. This way, you can run Java programs on a…
Popularity: 87
In Java it is related to the class hierarchy of exceptions. Throwable is the root object of the heirarchy, and both Exception and RuntimeError subclass it. Methods include a "throws" clause in their signature to indicate errors of type "Exception" that can be thrown in the body of the method and r…
Popularity: 92
JRE includes (JVM ) java virtual machine and some other library files. That runs a java application. JVM - understand the corresponding byte code of a java class and make it ready for run. Another Answer: The Java Runtime Environment (JRE) is an implementation of the JVM (Java Virtual Machi…
Popularity: 223
A simple way to do this, whatever the language used, is to step through the characters in the string one by one and compare them with a previously established set of vowels, adding one to a count value every time a character matches one of the vowels. The count value at the end will be the number of…
Popularity: 89
Answer When there is no further use of derived class obect in execution sequence then It gets deleted. calling of distructor sequence is reverse of constructor calling sequence ,so first derived class obect deleted than base class obect.
Popularity: 87
Answer In Java, if there is a run-time error then it allows the user to explicitly handle it by catching it in the catch block. If there is any error in the try block of code, automatically the flow control will be transferred to the catch block. Here Exception e indicates any exception. Answer…
Popularity: 93
Java is a OOP language and it is not a pure Object Based Programming Language. Many languages are Object Oriented. There are seven qualities to be satisfied for a programming language to be pure Object Oriented. They are: Encapsulation/Data HidingInheritancePolymorphismAbstractionAll predefined ty…
Popularity: 96
Answer Almost all controls' ActionListener triggers the actionPerformed upon the enter key press Answer Using an anonymous class implementation: Component c; // this is the component you want to add a listener to c.addKeyListener(new KeyListener() { public void keyPressed(KeyEvent e) …
Popularity: 129
Answer The first step is to install the XCode developer tools that comes with OSX. You can do this by looking on your OSX install disc. There should be a folder for optional installs, and a package for XCode. This will automatically install gcc, a C compiler, on your machine. Next, find th…
Popularity: 98
ABCAdaAlgol 60Algol 68APLArcAssemblyAwkBASICBatchBCPL BefungeBETACC++C--C# (pronounced C-sharp) CHILLClipperCobolCobolScriptComponent PascalCycloneDDATABUSEuphoriaForthFortranFree PascalGNU PascalIconIDLJalJavaScriptJovialLagoonaLedaLimboLuam4MapleMathematicaMATLABModula-2Modula-3MumpsOberonObject…
Popularity: 156
NO full form of java. just it stands for hot and aromatic coffee.It is just an abstract name that the devlopers gave.
Popularity: 94
Core Java has to do with the basic package of Java objects that are typically used for general desktop applications. These objects come in the 'Standard Edition' of Java Advanced Java could actually refer to any advanced topic having to do with Java programming-- and there are many. The other pac…
Popularity: 150
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 obje…
Popularity: 160
Java is pure object oriented programming language than c++, it uses the concepts of Classes, Objects, Inheritance, Polymorphism. And the execution of a program is non-linear. Java's motto (so to speak) is "write once run anywhere". When you compile a Java program, an intermediate bytecode is gener…
Popularity: 133
I would say it impossible not to do it right!
Popularity: 92
Dynamic Binding means declaring variables at run time only rather than declaring it at compile time.
Popularity: 93
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]; byt…
Popularity: 170
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 …
Popularity: 137
It means that you have tried to use a method which doesn't exist.
Popularity: 149
Remember that the Vector class is a subclass of AbstractList. Also remember that the Collections class has an efficient sorting method which works on lists. // Sample code: // Create a new Vector and fill it with out-of-order data Vector<Integer> v = new Vector<Integer>(); v.add(9)…
Popularity: 124
an Object is an instance of the Class for ex: Integer i = new Integer (1); i is an object of the Class Integer. of courses classes contain variables and methods and constructors. although the Object Class is a different case, it's the main class that all the classes in java are subClasses of it
Popularity: 136
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 app…
Popularity: 148
Yes. There is no specific order in which the compiler expects methods to be present. As long as the method is inside the class it is perfectly fine.
Popularity: 124
Inheritance is an object oriented feature supported by Java wherein the features of one Java class can be inherited/made available in another class. This creates a parent child relationship between these 2 classes. Class Inheritance in java mechanism is used to build new classes from existing class…
Popularity: 88
I will assume that you mean in a broad spectrum in this answer. Java is intended to be a cross-platform full programming language. It has the three (or four) control structures necessary for any program: Sequence, Descisions, and Loops (and Modules, functions and classes).This means that it can m…
Popularity: 97
As there are more than one JVM implementations, there is not a single language used to implement them all. Off the top of my head, I can list JVMs that are implemented in C, C++, Java (yes, a JVM in Java), Objective C, and even one in Javascript (don't ask why).
Popularity: 123
Below is a simple example- the function of the code below is to print out the words "Hello" "world" to the screen. public class Hello {//opens class public static void main(String args[]) //main method { System.out.println("Hello world"); //prints words in brackets to the screen }//closes main…
Popularity: 139
//call this method inputing the string you want to testprivate void palindromeTest(String input){String output = """+input+"" "; output = output + ((getReverseString(input).equals(input)) ?"is a palindrome" : "is not a palindrome");System.out.println(output);}private String getReverseString(String i…
Popularity: 143
In object oriented programming language, it is possible to override classes. and the advantage over this is we can just show the or run the methods of the base class.
Popularity: 146
This is a way to organize files when a project consists of multiple modules. It also helps resolve naming conflicts when different packages have classes with the same names. Packages access level also allows you to protect data from being used by the non-authorized classes.
Popularity: 122
The important features of Java are the ones that relate to the object oriented concepts like: a. Inheritance b. Polymorphism c. Encapsulation d. Data Hiding e. Data Abstraction etc
Popularity: 139
That one is called "Java Virtual Machine".
Popularity: 150
Yes. If you simply write: x = new SomeClass(); y = x; will make the variable y refer to the same object that variable x is referring to.
Popularity: 146
It is possible in JDK 1.5 and above. In JDK 1.4, you also cast the Float value into float value by using casting. For exampe in JDK 1.5, its possible float f = 12; Float ff = f; but in JDK 1.4, you will use casting i.e float f = 12; Float ff = (float)f;
Popularity: 118
JPanel is a general purpose container used to organize and manage the groups of related components. It is a light weight container which can be contained within another container.
Popularity: 238
Over abstraction, in computer programming terms, means that you use inheritance too often in your code. If you look for any two classes which share a common function and make an abstract class for them to inherit, then you are most likely guilty of over abstraction. This is a common problem found i…
Popularity: 126
String tokenizer is a utility feature in Java language that is used to split a string into multiple pieces based on a delimiter. Ex: AB,CD,EF,GH - If the preceding string is tokenized using the string tokenizer with "," as the delimiter it would result in four values which can be used individually.
Popularity: 109
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, i…
Popularity: 153
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+…
Popularity: 171
Implicit casting is done automatically by the compiler and virtual machine. Explicit casting is needed to convert types of data when Java is not sure if the result will be valid. There are two times when you will need to perform explicit casts: casting between primitives and casting between objects…
Popularity: 119
An Access Modifier is a key word in java that determines what level of access or visibility a particular java variable/method or class has. There are 4 basic access modifiers in java. They are: PublicProtectedUnspecified (package-private)Private Classes can only be declared public or left unspecifie…
Popularity: 144
arguments
Popularity: 88
It is used to convert the value of one datatype into a value of another datatype. Example- Integer.parseInt(in.readLine); It converts given value to Integer datatype.
Popularity: 115
VB.NET is used for e-banking.It is the language in which all the options are used just by tool box that is at the right hand side of the window. This question is like asking "what brand of wrench is used to make cars?". There are thousands of different e-banking sites and connections, and they use …
Popularity: 96
No. An abstract method must be overriden in an subclass. If the method is final then it can't be edited.
Popularity: 135
A (java) class file was not be made to be opened and modified by hand for the users. A class file is the resulting byte code of your java file compilation.This class file can be interpretaded for any jvm. To run your java class you only need to write these instructions in your command line.java [ op…
Popularity: 122
C# and Java have many similaries. If you learn one, you won't have much of a problem learning the other.
Popularity: 144
He is the father of the Java programming language.
Popularity: 147
Instantiate means to create an actual instance of a Class. That is, the creation of an Object of that Class. This allocates memory on the heap for that object. Instantiate creates a unique object of that class, complete with its own copy of any class variables. Thing of a Class as a design spec, whi…
Popularity: 107
Classes in Java inherit constructors from their parent classes. If you don't explicitly define a parent class, then Object is used, which has only the default empty constructor. That "default" constructor is only there when defined by the parent class, so classes which do not have a no-argument con…
Popularity: 140
Jar files are basically zip files, but they are supposed to store java classes, they have nothing to do with C.
Popularity: 134
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.
Popularity: 153
Because, they are not methods to have a return type. The constructor by default creates an object of the class and that's all. It does not return any value, hence it has no return type. The above hints at the reason why constructors don't have a declared return type, but let's make it explicit: Cons…
Popularity: 129
There is no explicit limit, but the amount of your (virtual) memory does limit that.
Popularity: 98
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.
Popularity: 154
It can have as many as you want. It allows you to catch very specific exceptions. -- Ac352 Answer Having more than one catch statement is a bad idea. A better approach is to analyze the error and go from their. Here is an example. Try My.Computer.FileSystem.DeleteFile("C:\TEST.txt") Catch ex As …
Popularity: 135
Data abstraction provides the skeleton or templates. That is it has no actual implementation.
Popularity: 94
Yes, in some way it's similar. One difference is that Java Bytecode is typically interpreted by the virtual machine, while MSIL is JIT-compiled to native machine code before executing. However, it is increasingly common for bytecode to be compiled as well.
Popularity: 122
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. T…
Popularity: 163
Bubble sort will be able to sort the items lexicographically, if you first assign the strings a relative value. The way strcmp in the C library does this is by returning the difference of the first different characters between the strings. For instance, if you call strcmp("Hello", "Highway"), strcmp…
Popularity: 147
The keyword static simply means that the method does not need to be assigned to an instance of an object. Because the main method is the first method executed, it is not attached to an instance.
Popularity: 91
Abstract is not a datatype but a modifier. Abstract can be used in 2 places:Methods: If a method is termed abstract it means that the current class does not provide an implementation for this method and the first concrete subclass will do the same. Classes: Any class that has one or more abstract me…
Popularity: 138
the main thread is the first thread that creates when the JVM starts executing your program. All subsequent threads that you may create in your program would be child threads to the main thread. It is important to note that if the main thread exits, all other threads that were spawned by it will als…
Popularity: 93
Because they are created and destroyed on 'last-in-first-out' principle.
Popularity: 163
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.
Popularity: 155
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
Popularity: 155
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.
Popularity: 148
A subclass in Java is a class that inherits features from a parent class. class Car { public void goForADrive() { System.out.println("driving a car"); } // more code } class Ferrari extends Car { public void takeFerrariForADrive() { System.out.println("driving a Ferrari"); } // more code …
Popularity: 93
The exact same way you instantiate a class from any of the various Java libraries: by using the 'new' keyword. i.e MyClass A = new MyClass(); this forces the MyClass definition to run its Constructor method, and return an instance of object of type MyClass.
Popularity: 124
You cannot override a method inside the same class. If you do that, it is called Overloading. Experienced java programmers can clearly identify the difference between overloaded methods and the overridden ones. We just had a detailed look at overridden methods and it is time to take a look at the ov…
Popularity: 135
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 positioni…
Popularity: 151
Imagine you want to save the state of one or more objects. If Java didn't have serialization, you'd have to use one of the I/O classes to write out the state of the instance variables of all the objects you want to save. The worst part would be trying to reconstruct new objects that were virtually i…
Popularity: 135
final is a keyword.it can be used for three posibilities. they are ->we can assign the variable as final. to declaring the variable as final to avoid the reusability of a variable. now i display small program for this type. class A { final int i=10; a(int b) { i=b; System.out.println(i…
Popularity: 124
method invoking refers to the action in which we call a Java method from within another java method or class. Method invocation is analogous to a function call in procedural programming.
Popularity: 140
'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. …
Popularity: 171
Tokenizing is the process of taking big pieces of source data, breaking them into little pieces, and storing the little pieces in variables. Probably the most common tokenizing situation is reading a delimited file in order to get the contents of the file moved into useful places like objects, array…
Popularity: 135
A class file is a compiled .java file and cannot be executed without jdk or java. They are often executed with .bat files in windows for convenience
Popularity: 127
• Instance variables and objects live on the heap. • Local variables live on the stack. Let's take a look at a Java program, and how its various pieces are created and map into the stack and the heap: 1. class Maine { } 2. 3. class Lion { 4. Maine c; // instance variable 5. String name; /…
Popularity: 143
Yes. Overridden methods have the same signature whereas Overloaded methods have a different signature
Popularity: 137
"Overloading" a function means that you have multiple functions with the same name, but different signatures. The signature of a function is its return type and number/types of parameters. For example: void foo(int a, char b) can be distinguished from void foo() which can be distinguished from …
Popularity: 100
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
Popularity: 153
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.
Popularity: 155
The rules of accessibility are governed by the access modifiers. An Access Modifier is a key word in java that determines what level of access or visibility a particular java variable/method or class has. There are 4 basic access modifiers in java. They are: 1. Public 2. Protected 3. Default and …
Popularity: 143
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.
Popularity: 155
1. Single Inheritance A Scenario where one class is inheriting/extending the behavior of just one super class. Ex: public class Ferrari extends Car {…} This can be taken much further, where one class is inheriting/extending the bahavior of another class which in turn is inheriting behavior f…
Popularity: 112
This depends on your handset. Certain devices are java-enabled, older ones are not.
Popularity: 135
Depends on the language. For C, no you don't. You can type blank brackets (int Arr[]) when declaring the array, or you can just use a pointer (int* Arr). Both will allow you to use the variable as an array without having to declare the specific size. Hope this answers your question. In Java, an arr…
Popularity: 95
The speed difference is not usually significant, but the slight performance advantage goes to Servlets because, JSPs get converted to Servlets before execution and since Servlets do not have this conversion phase, they are a little and I mean only slightly little faster than JSPs
Popularity: 93
A switch won't help you in drawing flowcharts, but there are flowcharts templates, witch do.
Popularity: 101