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

What is object oriented paradigm in java?

the concept of "pure" in object orientation is a little subjective and not quite well defined in practice, but there are pure object oriented programming languages. The principles of object orientation on the other hand are well defined. Programming languages are quite nested in complicated materials, and it is hard to say that everything must be an object, since all formal systems need primitives. How can you define an object without the notion of an object as a definition? This all comes down to type theory, and one can't define everything as "something" without knowing the "something". With this, Java is not actually a pure object oriented programming language since it needs primitives. The only way you can yield a pure programming language with no primitives is not even having the notion of defining concrete terms in a programming language since it doesn't have primitives in it.

Smalltalk is an example of a pure programming language. With this, I can't exactly answer the question since you've presented two OO programming languages, neither of which is "pure".

-Fabianski Benjamin

India

What year java was implemented?

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java platform.

Newer versions of Java have been released on a regular basis...

Who invented java software?

Java was originally developed by James Gosling at Sun Micro systems and was released in 1995. This language was re-written many times and updated with more classes and packages. One man that made a great contribution to these updates is a man named Bill Joy, also known as "The einstein of the internet."

What are multithreading concepts in java?

Multithreading in Java is the concept by which you can have multiple threads of execution running in parallel. Unfortunately the topic is too big to be summarized in one answers. You can check the related links section for links that can help you understanding this complex topic

What is compile time?

Compile Time: In longer form, you might say, "at the time of compiling", or, "when the program is compiled".

When you compile a program, the compiler applies various processes to your source code in order to generate the executable files. These are actions that happen "at compile time".

Other actions happen when you actually run the finished program. These actions are said to occur, at, or in, "run time".

Why is java is neutral platform independent?

Java solves the problem of platform-independence by using

byte code. The Java compiler does not produce native

executable code for a particular machine like a C compiler

would. Instead it produces a special format called byte

code. Java byte code written in hexadecimal, byte by byte,

looks like this:

CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08

This looks a lot like machine language, but unlike machine

language Java byte code is exactly the same on every

platform. This byte code fragment means the same thing on a

Solaris workstation as it does on a Macintosh PowerBook.

Java programs that have been compiled into byte code still

need an interpreter to execute them on any given platform.

The interpreter reads the byte code and translates it into

the native language of the host machine on the fly. The most

common such interpreter is Sun's program java (with a little

j). Since the byte code is completely platform independent,

only the interpreter and a few native libraries need to be

ported to get Java to run on a new computer or operating

system. The rest of the runtime environment including the

compiler and most of the class libraries are written in Java.

All these pieces, the javac compiler, the java interpreter,

the Java programming language, and more are collectively

referred to as Java.

What is concrete class in java?

A method which is not abstract i.e. if a methods definition is given in the same class its declared is called concrete. where as abstract method would have no definition till the deep down of the hierarchy of class structure but ll ve a declaration in all the subclasses and definition in one subclass after which it need not be declared in the further subclasses. By the way defining the abstract method in a subclass would end the carrying of the declaration till down, but defining it is not mandatory where declaring is mandatory.

What is a large array?

one of the world’s largest radio observatories

How does a function differ from a procedure?

In closed subroutine a subroutine stored outside the main routine can be connected to it by linkages at one or more locations.

whereas in open subroutine is a set of computer instructions i.e. a subroutine that performs some particular program and insert them directly each and every time that particular function is required

Explain classes of java.lang package?

The lang package contains classes for data types like Boolean, String etc and also some other classes like Thread.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/package-summary.html

Refer this for complete details.

Difference Between interpreter and compiler in java application?

Due to platform independence, a Java compiler will interpret Java source code into Java Byte Code and pass to the JVM, which will pass machine understandable code through to cpu. (clarification needed).A conventional compiler converts source code directly to machine code.(clarification needed).

Disadvanatges of object-oriented programming languages?

  • OOP is a more complicated and structured paradigm than, say classic procedural programming.
  • More planning and design is required on the programmer's part.
  • OOP is less efficient in terms of a computer's resources than most other paradigms.
  • OOP is a complex idea - no language including Java and C++ implements it perfectly.
  • OOP may be overkill for smaller, simpler programs.

Why c is preferred over Java for embedded system?

Embedded systems typically run on extremely limited hardware. Even the smallest implementation of Java (Micro Edition) can't compete with a small C implementation both in terms of memory footprint and execution speed.

How do you write a java program to find the sum and average score of three marks scored by ten students?

import java.io.*;

class summ

{

public static void main()throws IOException

{

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

int a[]=new int[10];

int sum=0;

float avg=0;

for(int i=0;i<10;i++)

{

System.out.println("Enter marks of student "+(i+1)+" : ");

a[i]=Integer.parseInt(in.readLine());

sum+=a[i];

avg=sum;

}

avg/=10;

System.out.print("Sum= "+sum+"\nAverage= "+avg);

}

}

Is 'k equals k plus 1' same as 'k plus equals 1' in Java?

Yes, they are exactly the same, both of them increment k in 1.

Write a program take three strings from the command line and display the number of characters in each string in java?

class BackString

{

public static void main(String[] args)

{

//work out the length of args[]

int len=args.length;

//cycle forwards through the array string

for (int i=0; i<len; i++)

{

//how long is the word in characters?

int wordLen = args[i].length();

//cycle backwards through the word a char at a time

for (int j=wordLen-1; j>=0; j--)

{

System.out.print(args[i].charAt(j));

}

System.out.print(" ");

}

}

}

What is the major difference in class and interface in c?

The implementation detail. Classes may provide a default implementation, interfaces provide only the method signatures

What do you compile?

Compiling is the act of translating human-readable source code to machine-readable byte code.

In Java, the compiler program is javac

Program for doing upercase of 1st letter of string?

#include<stdio.h>

#include<conio.h>

#include<ctype.h>

main()

{

char string[80];

int n,k=0;

clrscr();

while((string[k]=getche())!='\r')

k++;

string[k]='\0';

n=k;

k=0;

while(k<n)

{

putchar(toupper(string[k]));

k++;

}

}

Algorithm for infix to prefix conversion?

Algorithm to Convert Infix to Prefix Form

Suppose A is an arithmetic expression written in infix form. The algorithm finds equivalent prefix expression B.

Step 1. Push ")" onto STACK, and add "(" to end of the A

Step 2. Scan A from right to left and repeat step 3 to 6 for each element of A until the STACK is empty

Step 3. If an operand is encountered add it to B

Step 4. If a right parenthesis is encountered push it onto STACK

Step 5. If an operator is encountered then:

a. Repeatedly pop from STACK and add to B each operator (on the top of STACK) which has same or higher precedence than the operator.

b. Add operator to STACK

Step 6. If left parenthesis is encontered then

a. Repeatedly pop from the STACK and add to B (each operator on top of stack until a left parenthesis is encounterd)

b. Remove the left parenthesis

Step 7. Exit

How do you get a default constructor?

The default constructor is an empty (only call the super constructor) with no parameters constructor inserted by the java compiler when you don't define a constructor in your class. If you write something like this:

public class NoConstructorClass{

//no constructor goes here

}

Then you get something like this:

public class NoConstructorClass{

public NoConstructorClass(){ // Default constructor that you didn't write

super();

}

}

What is a default package in Java?

A default package is a package with no name. You can create a Java class without putting package name on top of the code. This class is included in the "default package".

Be careful not to be confused with java.lang, which is a package that contains Java's fundamental classes and get's imported by default.

Download JRE 1.5.0 09 for Vista?

You can download the Sun Java JRE Version 1.5.0_09 Here: http://java.sun.com/products/archive/j2se/5.0_09/index.html

What are arrays?

  • Array data structure, an arrangement of items at equally spaced addresses in computer memory
  • Array data type, used in a programming language to specify a variable that can be indexed
  • Associative array, an abstract data structure model that generalizes arrays to arbitrary indices

or various kinds of the above, such as

  • Bit array or bit vector
  • Dynamic array, allocated at run time
  • Parallel array of records, with each field stored as a separate array
  • Sparse array, with most elements omitted, to store a sparse matrix
  • Variable-length array
  • Ragged (jagged) array, where the rows have different lengths individually

or various related concepts:

  • Array processor, a computer to process arrays of data (not to be confused with a processor array)
  • Array programming, using matrix algebra notation in programs (not the same as array processing)
  • Array slicing, the extraction of sub-arrays of an array
  • APL (programming language)

or also:

  • Video Graphics Array (VGA), a display adapter and video format, and many variants thereof (EVGA, FWVGA, QVGA, QXGA, SVGA, SXGA, SXGA+, TXGA, UVGA, XGA, XGA+, ...)