What are different types of inner classes ?

Answers

Answer 1

Answer:

Inner class in Java is basically a class in a class, i.e. a member of another class.

There are 4 types of inner classes in Java.

a)  Nested Inner class

b)  Method local Inner class

c)  Anonymous Inner class

d)  Static nested class


Related Questions

Develop a program that will calculate the area and perimeter of a rectangle. The length and width can be given as constant.(LENGTH= 8 WIDTH=8).

Answers

Answer:

#include <iostream>

using namespace std;

int main()

{

 

  int length = 8;

  int width = 8;

 

  int perimeter = 2*(length + width);

  int area = length * width;

 

  cout<<"The perimeter is "<<perimeter<<endl;

  cout<<"The area is "<<area<<endl;

 

  return 0;

}

Explanation:

include the library iostream for using the input/output instructions in the c++ programming.

Create the main function and define the variable length and width with values.

Then, use the formula for calculating the perimeter and area of rectangle.

[tex]perimeter = 2*(length + width)[/tex]

[tex]area = length * width[/tex]

and store in the variables and finally print the output.

What is the Moore's law

Answers

Answer:

Hi, in the law of Moore we can express aproxitmaly for each two years is duplicated the number of transitors in a microprocessor.

Explanation:

In around 26 years the number of transitors has increased about 3200 times, a transitor is a way to regulate the current voltage flow and can be act like a switch for an electronic signal.

I hope it's help you.

Answer:

The power of microprocessors would double every two years

Explanation:

put is a function to __________.

Ex:cout.put(aChar);

A)get one next character from the input stream
B)input one next character to the input stream
C)put one next character to the output stream
D)output one next character from the input stream

Answers

Answer: put one next character to the output stream

Explanation:

put is a member of the output stream class. So using the code cout which means displaying and the put method which places a character to the output stream. It is in use in C++.

With theuse of which of the following, we reason from a generalization to aspecific conclusion?

a- Analogy

b- Logic

c- Induction

d- Deduction

Answers

Answer:

d-Deduction

Explanation:

Deduction

In deductive inference, we maintain a hypothesis and we predict its implications on the basis of it. That is, we predict what the results should be if the theory were right. We go from the general theory to the particular observations.

Induction

We're going from the specific to the general inductive inference. We make a lot of observations, discern a pattern, generalize and infer an explanation or theory.

Analogy

An analogy is a comparison between two objects or object systems, highlighting the respects in which they are considered to be similar.

Logic

Science dealing with the principles and criteria of validity of inference and demonstration that is science of formal rules of reasoning.

Convot the following biliary number into decimal form using any method ? (1010.100)2

Answers

Answer:

10.5

Explanation:

1010.1

Handy method you can find searching google images, and I originally learned

from some guy teaching an online java course.

.1 --> 1 * 2^(-1) = 0.5

0 --> 0 * 2^(0) = 0

1 --> 1 * 2^(1) = 2

0 --> 0 * 2^(2) = 0

1 --> 1 * 2^(3) = 8

0.5 + 2 + 8 = 10.5

If for some reason it isn't very clear, just take the number, (x) and multiply it

by two to the power of the position it is in. (e.g. first number before decimal point is 0, second 1, etc).

.the test team devives from the requirements a suiteof:
A.acceptance tests B.regression suite C.buglist D.priority list

Answers

Answer:

A. acceptance tests

Explanation:

In acceptance testing, the system is tested for acceptability to the end user. In order to do this it needs to be validated against the specified requirements. The testing team derives the acceptance tests from the requirement specification.

It generally corresponds to the last phase of testing operations for the system when the system is considered stable enough to be offered to the end user. If the system fails to satisfy the acceptance testing criteria, it needs to go through further rounds of iterative development.

What are the details of frame transmission andreception that LAN interface handles?

Answers

Answer and Explanation:

LAN transmission and reception handles the given bellow details  

LAN adds hardware address and use for error detection codes Use DMA to copy frame data directly from main memoryit follows access rule then transmission is in progressit also check the address where data is sent on incoming frames

if the destination address completely match with location address a copy of the frame is passed to the computer

in LAN system a single pocket is sent to the one or more nodes  

____________ is the most general and least usefulperformance metrics for RISC machines
o MIPS

o Instruction Count

o Number of registers

o Clock Speed

Answers

Answer: Instruction count

Explanation: Instruction count is the most general and least useful performance matrix for RISC machine because RISC is known for the reduced set of instruction so indirectly the instructions are less so there is not much requirement of keeping the count of instruction.other features mentioned in the question describes the performance factor of RISC machine and are the major factor behind the working of the RISC machine.

Answer:

Instruction Count

Explanation:

[tex]\text{Performance}=(\frac{\text{Instruction}}{\text{Program}} )\times(\frac{\text{clocks}}{\text{instruction}})\times(\frac{\text{seconds}}{\text{clock}})[/tex]

This is the formula for the Performance of Risc machines,as execution time is a product of three factors that are relatively independent of each other.As we can see that performance is directly related to the Instruction count,Clock speed and Number of registers.  

Instruction count (IC) is the most general and least useful performance metrics : the complete number of executions involving instruction in a program. Repetitive activities like loops and recursions dominate it.

The continue statement _________.
A)Disables the loop
B)Skips the loop
C)Transfer control to another code segment in the loop
D)Terminates the loop

Answers

Answer: C) Transfer control to another code

Explanation: Continue statement is a type of statement for the controlling of the loop. It has the main function of execution of the next  or another iteration. If the continue statement is executed inside a loop then the current execution of the statement will stop and jump on the next statement immediately and will transfer the loop there.

The resources assigned to them will significantlyinfluences the duration of most activities.

True
False

Answers

Explanation:

Assigned to whom? what resources??

Write a C++ programthat returns the type of a triangle (scalene, equilateral,or

isosceles). The input tothe program should consist of the lengths of thetriangle's

3 sides.

Answers

Answer:

#include<iostream>

using namespace std;

int main(){

   //initialize

   int a, b,c;

   //print the message

   cout<<"Enter the three sides of the triangle: "<<endl;

   //store in the variables

   cin>>a>>b>>c;

   //if-else statement for checking the conditions  

   if(a == b && b == c && a == c){

       cout<<"\nThe triangle is equilateral";

   }else if(a != b && b != c && a != c ){

       cout<<"\nThe triangle is scalene";

   }else{

       cout<<"\nThe triangle is isosceles";

   }

   return 0;

}

Explanation:

Create the main function and declare the three variables for the length of the sides of the triangle.

print the message on the screen for the user. Then the user enters the values and its store in the variables a, b, and c.

use the if-else statement for checking the conditions.

Equilateral triangle: all sides of the triangle are equal.

if condition true, print the equilateral triangle.

Scalene triangle: all sides of the triangle are not equal.

if condition true, print the Scalene triangle.

if both conditions is not true, then, the program moves to else part and print isosceles.

What are the applications of assembly language where any heigher language become insufficient.???

Answers

Answer and Explanation:

we know that high level language gives the best optimized output but its not good as the codes are written in assembly language by human expert if the application is badly constrained in memory and we need fast running then we have to use assembly language directlyif any project is specific to a particular platform and never needs to transfer to any other platform then its better to use assembly language this much better output  

Final answer:

Assembly language is used in domains requiring direct hardware control or optimized performance, such as embedded systems, bootloaders, firmware, and performance-critical applications like game engines or signal processing software.

Explanation:

The applications of assembly language are particularly relevant in scenarios where control over hardware specifics is crucial, or where execution speed and efficiency are of paramount importance. Unlike higher-level languages, assembly language allows programmers to write code that is directly correlated with the machine instructions of the hardware, providing a high level of control and optimization. Some of the applications include writing code for embedded systems, such as microcontrollers in automotive sensors, or when creating bootloader and firmware software that operate at a very low level in the computer hardware. Additionally, critical performance applications which require highly optimized code, such as video game engines or signal processing software, often use assembly language to squeeze out extra performance where higher-level languages might introduce too much overhead.

Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2 × radius) Circumference (diameter × π) Surface area (4 × π × radius × radius) Volume (4/3 × π × radius × radius × radius)

Answers

Final answer:

To calculate the properties of a sphere, such as diameter, circumference, surface area, and volume, we can use a Python program that takes the radius as input and applies mathematical formulae for a sphere.

Explanation:

To create a program that calculates the properties of a sphere, we will use the following formulae for a sphere: diameter is 2 × radius, circumference is diameter × π (pi), surface area is 4 × π × radius², and volume is (4/3) × π × radius³.


Example Code in Python

Here is a simple Python program for calculating the properties of a sphere:

import math
# Input: radius of a sphere
def sphere_properties(radius):
   diameter = 2 * radius
   circumference = diameter * math.pi
   surface_area = 4 * math.pi * radius ** 2
   volume = (4/3) * math.pi * radius ** 3
   return diameter, circumference, surface_area, volume

# Example usage:
radius = float(input("Enter the radius of the sphere: "))
properties = sphere_properties(radius)
print(f"Diameter: {properties[0]}")
print(f"Circumference: {properties[1]}")
print(f"Surface Area: {properties[2]}")
print(f"Volume: {properties[3]}")

This program prompts the user to input the radius as a floating-point number, and then outputs the calculated diameter, circumference, surface area, and volume of the sphere.

An initialization expression may be omitted from the for loop if no initialization is required.



True False

Answers

Answer:

True

Explanation:

for loop is used to repeat the process again and again until the condition not failed.

syntax:

for(initialize; condition; increment/decrement)

{

    Statement

}

But we can omit the initialize or condition or increment/decrement as well

the syntax after omit the initialization,

for( ; condition; increment/decrement)

{

    Statement

}

The above for loop is valid, it has no error.

Note: don't remove the semicolon.

You can omit the condition and  increment/decrement.

and place the semicolon as it is. If you remove the semicolon, then the compiler show syntax error.

Write a test program that prompts the user to enter two strings and, if they are anagrams, displays is an anagram; otherwise, it displays is not an anagram

Answers

Answer:-Following is the program for the checking if 2 strings are anagram in c++:-

#include<bits/stdc++.h>

using namespace std;

int main()

{

   string ana1,ana2;//declaring two strings.

   int an1[256]={},an2[256]={};//declare two count arrays of size 256 an1 and an2.

   bool test=true;//taking a bool variable test = true for displaying the result..

   cout<<"Enter both the strings"<<endl;

   cin>>ana1>>ana2;//prompting the strings..

   for(int i=0;ana1[i]&ana2[i];i++) // iterating over both the strings.

   {

       an1[ana1[i]]++;//increasing the count of the characters as per their ascii values in count array an1.

       an2[ana2[i]]++;//increasing the count of the characters as per their ascii values in count array an2.

   }

   for(int i=0;i<256;i++)//iterating over the count arrays..

   {

       if(an1[i]!=an2[i])//condition for not anagram.

       {

           cout<<"not an anagram"<<endl;

           test=false;//making test false..

           break;//coming out of the loop.

       }

   }

   if(test)//if test is true only then printing..

   cout<<"is an anagram"<<endl;

   return 0;

}

Explanation:-

A string is said to be an anagram string of other string if it has same characters but in different order.

for example:-

string 1="raman"

string 2="manar"

string 2 is an anagram of string 1.

what is a networking.give types also?

Answers

Answer: Networking is the method of exchanging of the information or data through a shared medium with different nodes in a networking system. Different types of networking are :-

LANWANMANPAN

Explanation: Networking forms the basic connection for sharing of the data between different nodes on the same medium . There are different types of network that are present according to the certain requirements are as follows:-

LAN(Local area network)-consists of a network established at a single site, particularly for an single building or infrastructure.WAN(Wide area network)-it is for a very wide area and also a combination of many MAN's and LAN's together . MAN(Metropolitan area network)-it is larger than a LAN and particularly limited to a single building or site such as a college building or office building.PAN(Personal area network)-computer network for an individual person within a building.

What is the value of the following expression? (false || (4-3 && 6))

true

false

0

illegal syntax

Answers

Answer:

true

Explanation:

The operator '||' is called the OR operator. it is used in between the two Boolean values.

OR operator has four possible values:

First Boolean is TRUE and second Boolean is TRUE, result will be TRUE.

First Boolean is TRUE and second Boolean is FALSE, result will be TRUE.

First Boolean is FALSE and second Boolean is TRUE, result will be TRUE.

First Boolean is FALSE and second Boolean is FALSE, result will be FALSE.

consider the expression:

(false || (4-3 && 6))

the second expression (4-3 && 6) gives Boolean TRUE, because their is no point for condition false.

so, (false || True) gives TRUE result.

Final answer:

False. The expression (false || (4-3 && 6)) will result in false because the '&&' operator takes precedence over '||', and 4-3 evaluates to 1 which is considered 'true' in Boolean logic.

Explanation:

The value of the expression (false || (4-3 && 6)) is true. In this expression, ((4-3 && 6)) is evaluated first. Since 4-3 is 1, which is true, and 6 is also a non-zero number, which is considered true, the result of that part of the expression is true because both operands are true for the && (AND) operator. Then we have 'false || true', and since '||' is the OR operator, the expression is true if either side is true. Hence, the entire expression evaluates to true.

Which statement correctly tests int variable var to be less than 0 or more than 50?

Answers

Answer:

if-else statement.

Explanation:

if-else is the conditional statement that can be used for checking the condition.

Syntax of if-else statement:

if(condition){

statement;

}else{

statement;

}

if the condition put in the if part is TRUE, then the statement inside the if will execute. if the condition put in the if part is FALSE, then the else part will execute.

In the question for testing the variable var is less than or more than 50, if-else statement is best statement.

We can used like that:

if(var<0 || var>50){

printf("Test pass");

}else{

printf("Test failed");

}

In an e-credit card transaction the clearinghouse plays the following role:

A. validates and verifies the sellers payment information

B. initiates the transfer of money

C. transfers funds between the sellers bank and the buyers bank

D. all of the above

Answers

Answer:

validates and verifies the seller's payment information- A.

Answer:

Hi Samantha, i have a work with you.

If you want to stop a loop before it goes through all its iterations, the break statement may be used.



True False

Answers

Final answer:

The break statement is utilized to stop a loop prematurely in programming by exiting the loop before all iterations are completed.

Explanation:

The break statement in programming is used to stop a loop before it completes all its iterations. If the condition for the loop is True, the loop will keep running until the break statement is encountered, which then exits the loop.

Using a break statement helps in controlling the flow of the loop and is particularly useful in scenarios where you need to exit a loop prematurely based on certain conditions.

By strategically placing the break statement within a loop, you can efficiently manage when the loop should terminate, preventing it from running indefinitely.

The true or false questions.

The start directory of find is optional

Answers

Answer:

true

Explanation:

Find command syntax is as follows:

find [starting directory] [options]

For example:

$ find /tmp -name test

$ find . -name demo -print

$ find

As we can see in the last example, starting-directory and options can both be omitted and it will still be a valid command. When the start directory is omitted, it defaults to the current directory.

___ defines a series of standards for encoding audio and video in digital form for storage or transmission. Most of these standards include compression, often lossy compression.

a) JPEG b) ANSI c) ISO d) MPEG

Answers

Answer:

d) MPEG

Explanation:

MPEG stands for Moving Picture Experts Group.

It defines standards for audio and video compression on digital form for storage and transmission.

JPEG (Joint Photographic Experts Group)ANSI (American National Standards Institute)ISO ( International Organization for Standardization)

are also international standards but they are not related to dogotal video compression.

Built-in user accounts include only the Administrator account created during Windows installation True False

Answers

Answer: True

Explanation:

When an OS is installed, the first account created is the built -in user account. It is the administrator account for the purpose of recovery and to facilitate the set up.

The statement is false; there are several built-in user accounts in Windows besides the Administrator account, including Guest, System, and service accounts such as Network Service and Local Service.

The statement that built-in user accounts in Windows include only the Administrator account created during Windows installation is false. Windows operating systems usually come with several predefined accounts for system management and security purposes.

Beyond the Administrator account, there is also the 'Guest' account, which is normally disabled by default but designed for users who require temporary access to the computer. Moreover, there is the 'System' account, which is used by the operating system to manage system services and the 'Network Service' and 'Local Service' accounts which have specific privileges to run particular system services without requiring the full privileges of the Administrator account.

These built-in accounts are an essential part of Windows security management, with each serving different roles and representing different levels of access permissions within the operating system.

You may nest while and do-while loops, but you may not nest for loops



True False

Answers

Answer:

You may nest while and do-while loops, but you may not nest for loops - False

When used as parameters, _________ variables allow a function to access the parameter’s

original argument.

Answers

Answer:  reference

Explanation:

In an function if the variables are passed as reference variables this means that the variables are pointing to the original arguments.So the changes made in the function on the reference variables will be reflected back on the original arguments.

For example:-

#include<iostream>

using namespace std;

void swap(&int f,&int s)

{

    int t=f;

    f=s;

   s =temp;

}

int main()

{

int n,m;

n=45;

m=85;

swap(n,m);

cout<<n<<" "<<m;

return 0;

}

the values of m and n will get swapped.

#include<iostream>

using namespace std;

void swapv(int f,int s)

{

    int t=f;

    f=s;

    s=temp;

}

int main()

{

int n,m;

n=45;

m=85;

swapv(n,m);

cout<<n<<" "<<m;

return 0;

}

In this program the values of m and n will not get swapped because they are passed by value.So duplicate copies of m and n will be created and manipulation will be done on them.

___ consists of a central conductor surrounded by a shield (usually a wire braid).

a) twisted pair cable b) coaxial cable c) antenna d) optical fiber

Answers

Answer: Coaxial cable

Explanation:

Coaxial cable consist of an central conductor surrounded by a shielded material in form of an insulating plastic. These cables have a high bandwidth and has a higher speed as compared to twisted cable.

Therefore the answer is coaxial cable.

The order of the nodes in a linked list is determined by the data value stored in each node.

True

False

Answers

Answer:

False

Explanation:

Linkedlist is a data structure which is used to store the elements in the node.

The node has two store two data.

first element and second pointer which store the address of the next node.

if their is no next node then it store the NULL.

We can store data in randomly. Therefore, the order of node cannot be determine by data values.

we can use pointers for traversing using the loop because only pointer know the address of the next node, and next noe know the address of next to next node and so on...

Therefore, the answer is False.

23. Which of the following is most likely to violate a FIFO queue? A) supermarket with no express lanes B) car repair garage C) emergency room D) fast-food restaurant E) All of the above are equally likely to violate a FIFO queue.

Answers

E) All of the above equally violate a FIFO queue

Answer:

emergency room- C)

. The limitingcondition for a list might be the number of elements in thelist.
a. True
b.False

Answers

Answer:

True

Explanation:

Yes, the limiting condition of a linked list is the number of the elements that are present in the list. Consider a linked list contains  'n' number of elements, create an iterator which iterates over all the n elements of the linked list. So , in the limiting condition ( for loops , while loops, do while loops in all the looping conditions in fact in any conditions ) the iterator has to iterate over all the elements present in the linked list. So , the limiting condition is the number of elements in the list.  

What are the advantages in implementing a language with apure interpreter?

Answers

Answer:

The advantage of implementing a language with pure interpreter is source level debugging implementation operations are easy in a language with pure interpreter because all run time error messages refers to source level unit.For example-array index out of bound.

Other Questions
Why might some firms voluntarily pay workers a wage above the market equilibrium, even in the presence of surplus labor? Check all that apply. Higher wages cause workers to shirk more of their responsibilities. Paying higher wages encourages workers to be more productive. Paying higher wages enhances workers to adopt healthier lifestyles, enhancing their productivity. Paying higher wages increases worker turnover. What was one result of the boom in farm production in the 1870s?OA. Lower food pricesOB. Lower land pricesOc. Higher land pricesOD. Higher food prices Figure ABCD has vertices A(4, 1), B(2, 1), C(2, 5), and D(4, 3). What is the area of figure ABCD? Was there an earthquake right now in california Which of the following was the most likely reason President Truman decided to use atomic bombs against Japan?A. He feared the loss of life that would be involved in a conventional invasion of JapanB. He had an agreement with the Soviet Union to use advanced weapons to end the war quicklyC. The war was going poorly in Europe, so he needed to end the Pacific war quicklyD. He wanted to punish the Japanese people for the surprise attack on Pearl HarborA) is the correct answer I just passed a test with this question The graph of f(x) = 0.6x is replaced by the graph of g(x) = 0.6x + k. If g(x) is obtained by shifting f(x) up by 6 units, then what is the value of k?A.=-6B.=-1/6C.=1/6D.=6 how long have peolpe studied chemisty This is a form of load balancing where larger workloads are issued to IT resources with higher processing capacitiesa. Pay-Per-Use Monitorb. Asymmetric Distributionc. SLA Monitord. Workload Prioritization If a bike tire has 16 spokes spaced evenly apart, name its angles of rotation.Can you please solve and explain it A right pyramid with a square base has a base edge length of 24 feet and slant height of 20 feet. The height of the pyramid is 'blank' feet. The probability that a continuous random variable takes any specific valuea. is equal to zerob. is at least 0.5c. depends on the probability density functiond. is very close to 1.0 What is the value of x?= 32 = 36 = 37x= 40 PLEASE HELP ME ITS THE LAST QUESTION ONLY HAVE 10 MIN LEFT!!!!!!Tasha used the pattern in the table to find the value of 4 to the power of -4 (refer to the pictures)In which step did Tasha make the first error?Step 1Step 2Step 3Step 4 GEOMETRY - NEED HELP - WILL MARK BRAINLIESTQUESTION 1An observer is 120 feet from the base of a television tower, which is 150 feet tall. Find the angle of depression at the top of the tower. Round to the nearest degree.QUESTION 2Answer for the image posted below.QUESTION 3What is the opposite of sine called, and what is its triangle ratio? Use picture attached:Stardust the unicorn cover a distance of 50 miles on his first trip to the forest. On a later trip he traveled 300 miles while going three times as fast. Is the new time compared with the old time was:? A. The same timeB. A third as muchC. Three times as muchD. Twice as much Read this excerpt from Leo Tolstoy's The Death of Ivan Ilyich:Her attitude towards him and his diseases is still the same. Just as the doctor had adopted a certain relation to his patient which he could not abandon, so had she formed one towards himthat he was not doing something he ought to do and was himself to blame, and that she reproached him lovingly for thisand she could not now change that attitude."You see he doesn't listen to me and doesn't take his medicine at the proper time. And above all he lies in a position that is no doubt bad for himwith his legs up."She described how he made Gerasim hold his legs up.The doctor smiled with a contemptuous affability that said: "What's to be done? These sick people do have foolish fancies of that kind, but we must forgive them. . . ."They all rose, said good-night, and went away.When they had gone it seemed to Ivan Ilyich that he felt better; the falsity had gone with them. But the pain remainedthat same pain and that same fear that made everything monotonously alike, nothing harder and nothing easier. Everything was worse.Again minute followed minute and hour followed hour. Everything remained the same and there was no cessation. And the inevitable end of it all became more and more terrible.Based on the excerpt, how is Praskovya Fedorovna a character foil to Ivan Ilyich? Find the vertex form of y=(x+2)(x-3) The Romans are remembered most for their achievements in: Question 28 options: a) agriculture and literature. b) government and engineering. c) mining and metal production. d) innovative science and philosophy. Why did indians call for independence after world war 1? Why does a surplus exist under a binding price floor? It encourages sellers to produce less of the product. It encourages buyers to purchase more of the product. It makes the price so high that the quantity supplied exceeds the quantity demanded in the legal market. It makes the price so low that the quantity demanded exceeds the quantity supplied on the legal market. It discourages sellers from increasing the quality of the product they sell, which, in turn, increases the quantity demanded.