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

How do you make an program in object oriented programming?

Object Oriented Programming is the technique to create programs based on the real world..object oriented programming model programs are organized around objects and data rather than actions and logic. In OOP based language the principal aim is to find out the objects to manipulate and their relation between each other.OOP offers greater flexibility and compatibility and is popular in developing larger application.

What is inheritance explain with an example?

Inheritance is a feature in Java wherein one class will inherit or use the features of another class.

Ex: public class A extends B {

…

}

Here class A is the child class and B the parent. The child inherits the features/methods of the parent and can use them.

What is variable data?

A variable data is anything that won't necessarily be the same every time you run a computer program. It may come from user input, from a random function, from consulting a database, etc.

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?

Basically, the shunting algorithm (infix to postfix) works like this (I'm writing this from memory, BTW, so I apologize in advance for any mistakes):
1. You create a stack and an output string.
2. Then you read the infix string one token at a time; each token is either an identifier or an operator:
a. If the token is an identifier (eg, a variable or a constant), then you append it onto the end of the output string.
b. If the token is an operator, then you compare its precedence with the precedence of the operator on the top of the stack.
i. If the operator on the top of stack has lower precedence, then push the new operator onto the stack.
ii. Else, pop the operator from the top of stack and append it to the output string. Then push the new operator onto the stack.
otherwise
c. If the token is an open parenthesis, then push it onto the stack.
d. If the token is a close parenthesis, then pop and append the operators from the stack until the open parenthesis is popped. Discard both parentheses.

Google for "shunting algorithm" for a more detailed and better better description. You might also find reference to an algorithm for converting infix to prefix.
Algorithm_for_infix_to_prefix_conversion

refer this page for your question.....

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();

}

}