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

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 "Java" refers to both a language and a platform. The runtime and libraries that comprise the platform are based on the Java language and come in 3 flavors: Java SE (Standard Edition): Formerly J2SE but renamed to Java Standard Edition when the Java 2 convention was dropped with the r…
Popularity: 69
An abstract, as a noun, can refer to the summarization of an article or a text, as opposed to the full work. For example, online search engines sometimes show the full-text of an article and its abstract. Abstract Art In the same way, the artistic term abstract means "apart from existence." It appli…
Popularity: 67
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
The static keyword associated with a method or a variable in java specifies that the entity belongs to the class and not any object instance of the same.Static Methods Static keyword when used with a method, specifies that this method belongs to the class and not a particular instance of the class (…
Popularity: 74
The biggest disadvantage is to limit the program flow in 1-dimensional (or linear way). Most of software developers would have been brain-washed to think this way. When dealing with 2 dimensional subjects such as concurrency, multiple threads, synchronization, etc., the topics become E.T. subjects! …
Popularity: 72
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
Internet users can use java to create applet programs and run them locally using a "java enabled browser" such as hotjava they can also use a java enabled browser to download an applet located on a computer to download an applet located on a computer anywhere in the internet and run it on their loca…
Popularity: 79
//testing code//note that a space character should be neither a vowel, nor a consonantstring s = "This is a test";Console.WriteLine("Source string: {0}", s);Console.WriteLine("# of Vowels: {0}", GetCount(s, "aeiou"));Console.WriteLine("# of Consonants: {0}", GetCount(s, "bcdfghjklmnpqrstvwxyz"));// …
Popularity: 73
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
container class contains some abstract methods that are implemented in its subclasses that's why the container is an abstract
Popularity: 75
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
please give me research topic from database and more information
Popularity: 69
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
synchronized is a key word in java that is used while implementing multi threading to avoid deadlocks and dirty writes. A synchronized method can be accessed at a time by only one thread and all other threads have to wait. this ensures that data that is accessed by a method is consistent and does no…
Popularity: 68
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
my self is a computer teacher,from my point of view ,some project topics are: BANKINGONLINE QUIZBILL Preperationticket reservationA SMALL GAME
Popularity: 80
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
import java.io.*; import java.applet.*; import java.awt.*; public class flag extends Applet { public void paint(Graphics g) { g.fillOval(60,450,120,50); g.fillRect(110,60,10,400); g.setColor(Color.red); g.fillRect(120,80,150,30); g.setColor(Color.white); g.fillRect(120,110,150,30); g.se…
Popularity: 87
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
Implement this method: public static boolean isDivisible(int a, int b) { if(a % b == 0) { return true; } else { return false; } }
Popularity: 82
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
not an actual code line you need to redefine the script
Popularity: 87
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
is an array with more than one dimension each dimension has different size ex: 10 20 30 11 22 22 33 44 77 88
Popularity: 72
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
Yes - In every machine that has the Java Runtime Environment (JRE) installed, the JVM will be available.
Popularity: 85
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
The JVM is responsible for running all the java programs. It is also responsible for keeping the memory utilization of the system at its least. So, the JVM runs a scan through the memory searching for unused object references. If an object is not referred by any class or other objects, then the JVM …
Popularity: 74
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
The similarities are:a. They are both java basic object typesb. They both can contain variables and methods (With difference being class methods have implementation code whereas the interface methods can only have declarations)c. They can both be inherited using Inheritance (extends keyword for c…
Popularity: 75
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
Math is a pre-defined class in the package java.lang. It contain various predefined functions in it that help the users to carry out various mathematical operations in their programs. Various Math Functions are:: Math.pow(x,y) => x^y Math.sqrt(x) => Square root of 'x' Math.tan(x),sin(x),co…
Popularity: 69
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
Java is called write once and run anywhere bcoz in java we can write the program once and run on different operating systems like windows, Linux ,solaris. IT is compiled by the JVM this means java is JVM dependent and Operating System independent or platform independent .JVM converts into byte code.…
Popularity: 69
A switch won't help you in drawing flowcharts, but there are flowcharts templates, witch do.
Popularity: 101
No. Once a thread is stopped you cannot restart it.
Popularity: 79
It means indexing into an array. The array could be an array of built in primitive types or array of objects. The index must be a numeric value greater than or equal to 0.
Popularity: 69