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 type casting and what is the danger of casting from one type to another?

Type casting means that you explicitly convert from one type to another. Consider this example:

int x;
long y = 10;
x = y;

The compiler will protest, because of a possible overflow. Now, if you are confident - from a knowledge of the computer program you wrote - that there will be no overflow, you can explicitly:

x = (int) y;

You are telling the compiler that you know what you are doing. The danger, of course, is that you may be wrong, and there may still be an overflow.

The situation is similar if you convert from double to float, or from double or float, to integer. In all of these cases, there is a loss of precision.

How do you find the size of a class object?

Java does not have a sizeOf() operator and hence there is no way we can actually determine the size of a java class object. However we can analyze the overall heap space utilization to try to get an approximate indication of how much memory is used by an object but it is not accurate.

Will The Tomcat Web server will work on a stand-alone computer system?

Yes. The Tomcat Web server will work on a stand-alone computer system. It will need The Java environment installed on the same machine.

What are the different phases of java?

Based on the lecture i have , there are three JAVA PHASES

-- editor. First step in creating java program is by writing ur programms in a text editor. Ex, notepad, emacs etc

-- java compiler. compile. The program by. Using the java compiler. The output of this process is a file of java bytecodes wid the file extension.class

-- java interpreter. The .class file is then interpreted by java interpreter that converts the bytecodes into the machine language of the particular computer your using

---abioo4---

How do you call variable value declare in one class call to another class?

From the face value of the question, they are called message chain, or train rack (if one of them is null!?)

Do static methods operate on objects why?

No. Why? By definition. A static method is, precisely, a method that is not meant to operate on an object. It can only work with static fields, and other static methods, of its class.

What is the difference between object and variable?

A variable basically holds a single type literal in memory through defining its type, declaring it, and setting a value to it. If you meant reference variables, they are variables which refer to the memory location of an object previously set.

An object is the actual storage space in memory in which some collection of data resides (is stored). Objects 'live' in memory spaces known as 'heaps'.

What is the Difference between overflow and carry binary addition?

You have an adder circuit that can hold a maximum value of 100. With the carry it can hold values up to 199, the carry distinguishes between 31 and 131. But if the sum is greater than 199, you have overflow, because the circuit has no way of telling you what the actual value is.

[edit]


you have an overflow when the size of the result doesn't fit to the capacity of the memory sign of the result is different from what is expected (for example, getting a negative result when adding 2 positive numbers) The carry out occur when the size of the result doesn't fit to the capacity of the memory, yet its sign is correct.

Which member should be declared as static?

Members which are shared among all instances of a class should be static.

What is static char in C?

static storage class in C tells that:

The variable will have the default value as zero.

The variable scope will be the file in which it is defined.

RaVi

What is venous access?

Venous access introduces a needle into a vein, usually for the purpose of withdrawing blood or administering medication.

What access attribute should instance variables have?

The basic coding standard is - all variables must be private and you must only expose them to the outside world through accessor/mutator methods. You must not keep them public.

Write a Java program to assign the letter grades to students based on their average scores?

import javax.swing.JOptionPane;

public class StudentGradesWeek7

{

public static void main(String[] args)

{

String input = JOptionPane.showInputDialog ("Enter Student's grade in %");

int inputMark = Integer.parseInt (input);

char g = getGrade (inputMark);

JOptionPane.showInputDialog(null, "Student's grade is " + g);

}

private static char getGrade (int mark)

{

char grade;

if (mark >=70)

grade = 'A';

else if (mark >=60)

grade = 'B';

return;

}

}

Explain different types of variables in shell?

Environment Variables: Sometimes called special shell variables, keyword variables, predefined shell variables, or standard shell variables, they are used to tailor the operating environment to suit your needs. Examples include PATH, TERM, HOME, and MAIL.

User-defined Variables: These are variables that you create yourself.

Positional Parameters: These are used by the shell to store the values of command-line arguments

Where to get berserker class?

You get it in the battleon upgrade shop. You have to be member to buy.

Why httpservlet class called abstract?

Because, the creators of the servlet framework cannot give all the functionality that you might want in your application.

So, if they make their class abstract, you the developer will be providing all the functionality you need and still stick to the framework standards defined by them.

Can more than one JDK be installed on single OS?

Yes, just make sure that your classpaths are setup correctly so that you compile and run programs using the desired version of the JDK.

What is advantage of different firing order 351W verses 302?

There is no significant advantage other than less peak twisting stress over the entire length the crankshaft. The firing orders are 1-3-7-2-6-5-4-8 for the 351W and HO 302 motors vs. 1-5-4-2-6-3-7-8 for early 289 and 302 Windsor motors. Connecting rods 1 and 5, 2 and 6, 3 and 7, and 4 and 8 share the same crank journals. Looking at the firing order the early 289/302's fired 1 and 5 at the very front of the crank in order. This placed torque stresses from two cylinders in power stroke on the very front throw of the crank at the end furtherest away from the load of the crank. The later HO and 351W firing order places common power strokes further back in the crank, reducing peak twisting stresses over the length of the crank.