Can structured programs be inheritance?
Structured programming is not at all related to inheritance.
Structured programming is a paradigm that allows, amongst many other things, one to write code in a manner that nests decisions and processing in a logical, "structured" way. Inheritance, on the other hand, is an aspect of Object Oriented Design and Programming.
How many bitwise operators are present in Java?
The bitwise & operator performs a bitwise AND operation.
The bitwise ^ operator performs a bitwise exclusive OR operation.
The bitwise | operator performs a bitwise inclusive OR operation.
Which method is default by true in java?
I don't understand what you mean with "default by true"? Please clarify your question.
A Java method can have zero or more parameters, and it must have one return value. Any of these can be declared as "boolean", in which case the value can be either true or false.
Is it valuable learning java as a programming language?
Sure, Java is a good option as a programming language. However, there are other good options, too - for example, Python, PHP, C#, etc.
Java is a programming language invented and managed by Sun Microsystems. Its a way for humans to easily write code that computers can understand, which means its a "High Level" programming language. Java is perhaps most famous for its ability to be simply run on many different computing platforms, from PCs and Macs to mobile phones.
XML is simply a widely used system to very specifically organize data in a way that is unambiguous for machines to read and simple for humans to understand and write. It is NOT a programming language, but rather a standard for information exchange. If you are familiar with web code, its a bit like HTML except that instead of having the <...> tags agreed upon ahead of time, each new implementation of xml specifies its own tags.
Java byte code is the code that is output by the Java compiler. Byte code is not machine code, it must be interpreted to create the machine code. This is handled by the Java virtual machine. Pretty much every platform produced today has a Java virtual machine implementation, so the same byte code can be executed upon any machine. Byte code can be regarded as being the native language of the virtual machine, as opposed to machine code which is the native language of the physical machine.
Can NullPointerException be used with ArithmaticException using throws keyword in java?
No. You cannot throw or catch Null pointer exceptions
What structure is responsible for giving spring to your step?
The plantar fascia. It is also in your hands.
"nextInt()" gets the next integer entered by the user.
here is a simple code-
import java.util.Scanner
public class {
bhal bhal
Scanner in = new Scanner (System.in)
int x;
System.out.println ("enter a number");
x=in.nextInt();
}
here "in" is an object of the "Scanner" class and "nextInt()" gets the next integer from the user for "in" object and assigns it to "x" variable which is declared as int variable before.
How do you do fcfs program in easy method using java?
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
class fcfs extends JFrame implements ActionListener
{
JButton jb[] = new JButton[3];
JTextField jt1[],jt2[];
JLabel jl[],jl1,jl2,jl3;
JPanel jp,jp1;
Container con;
int k,p;
String str[] = {"SUBMIT","RESET","EXIT"};
String str1[] = {"Process"," AT","ST","WT","FT","TAT","NTAT"};
public fcfs()
{
super("fcfs scheduling algoritham");
con = getContentPane();
k= Integer.parseInt(JOptionPane.showInputDialog("Enter number of
process"));
jl1 = new JLabel("Process");
jl2 = new JLabel("Arival Time");
jl3 = new JLabel("Service Time");
jl = new JLabel[k];
jt1 = new JTextField[k];
jt2 = new JTextField[k];
for(int i=0;i<k;i++)
{
jl[i] = new JLabel("process"+(i+1));
jt1[i] = new JTextField(10);
jt2[i] = new JTextField(10);
}
for(int i=0;i<3;i++)
{
jb[i] = new JButton(str[i]);
}
con.setLayout(new GridLayout(k+2,3));
con.add(jl1);
con.add(jl2);
con.add(jl3);
int l=0;
for(int i=0;i<k;i++)
{
con.add(jl[l]);
con.add(jt1[l]);
con.add(jt2[l]);
l++;
}
l=0;
for(int i=0;i<3;i++)
{
con.add(jb[l]);
jb[l].addActionListener(this);
l++;
}
}//end of constructor
public void actionPerformed(ActionEvent ae)
{
int FT[] = new int[k];
int WT[] = new int[k];
int TAT[] = new int[k];
float NTAT[] = new float[k];
float sum=0;
float avg;
JPanel main = new JPanel();
main.setLayout(new BorderLayout());
jp = new JPanel();
jp1 = new JPanel();
jp.setLayout(new GridLayout(k+1,7));
jp1.setLayout(new FlowLayout());
if(ae.getSource() jb[1])
{
setVisible(false);
fcfs window = new fcfs();
window.setSize(400,300);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
}//END ACTION PERFORMED
public static void main(String[] args)
{
fcfs window = new fcfs();
window.setSize(400,300);
window.setVisible(true);
window.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}//end main
}//end class
Object Oriented Programming (OOP) is the implementation (programming) of Object Oriented Design (OOD). The two usually go together, in in OOD/OOP. OOD is a concept where the design of a solution to a problem revolves around the objects it manipulates, specifically, standardizing the way we think about the attributes (data) and methods (operations) available in an object. While C++ is particularly well suited to OOP, the OOP paradigm can (and should) be extended to cover everything that a program manipulates, even to the extent of simple scalar variables such as an integer. This philosophy is based on some of the definitions of a "object", i.e. that is has storage, the contents of that storage has meaning, and that there are certain operations that can be performed on that storage using a defined interface. Using this concept, even an assembly programming language can be considered to be an Object Oriented Programming Language (OOPL)! What makes C++ and other OOPL's unique are the added concepts of inheritance, polymorphism, and data encapsulation, to name just three. Inheritance is the concept that an object can be declared/defined, and then a child object can inherit the parent object's design and extend it to include other, more specific, functionality. For example, you could design an object (we call them classes) that represents a person. The person class could describe a person's name, address, and social security number. The type of functions (we call them methods) that you could perform on a person could be to set or get their name, address, and social security number. You could then design a class that represents an employee. It could use class person as a base class, and then extend that implementation to include things such as work location, job title, and salary. Class employee has all of the capabilities of class person, but you do not have to write a single line of code for that implementation - you just write the code for the employee extension. Polymorphism is the concept that you can have pointers to various classes, and invoke a same named method, such as "print()", and the code selected will be the code for the type of object to which the pointer refers to. For example, person.print() would behave different than employee.print(). While this might seem trite, it becomes important when you have pointers that can refer to multiple types of related classes, and you want to virtualize the interface to classes pointed to by those pointers at run time, instead of at compile time. Data Encapsulation is, perhaps, one of the most important aspects of OOP/OOD. You design a class, such as person. Inside that class, lets say you define the person's name as an array of characters, say of length 25. You hide that attribute from any derived classes, such as employee, and force access to person.name though a method such as person::getName(). Everything is fine until one day, when you get a person with a 27 character name. You refactor the class person. You could make the array be 64 characters but, instead, you make it a pointer to a dynamically sized array. If you designed the interface person::getName() correctly, then the derived class employee does not need to change, you can relink everything and all is well. This capability can not be overestimated. Prior to OOD/OOP, there was a tendency for programmers to write code that used global variables, variables with scope throughout the program. As the program evolves, functions use those variables in ways that depend on the implementation. One day, you change the implementation, and now you need to go on a "hunt and destroy" mission to find all references to that variable. You might miss some. Bad. Worse, some function misunderstands the variable and uses it for something else, damaging it. Later, often much later, the program crashes, but not at a point that makes any sense. Data encapsulation is the concept of making variable (attributes) of a class be totally private to that class. The defined, or exposed, methods and (sometimes) attributes of a class is called the public interface. So long as that public interface does not change, then any user of that class does not need to be changed when the non-public part of the class changes.
How does java pass primitive types and objects?
Java uses only pass by value. Primitive data types are passed purely as pass by value whereas for objects a value which is the reference to the object is passed. Hence the whole object is not passed but its reference gets passed. All modifications to the object in the method would modify the object in the Heap.
What language is completely object oriented c plus plus or java?
Java is the complete object oriented Programming Language as every thing in java is an object,
WAP to print a wonderous square in java?
//Wondrous Square
import java.io.*;
class Wsq
{
public static void main(String args[])throws IOException
{
int n;
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
System.out.print("enter input:");
n=Integer.parseInt(br.readLine());
int i,j;
int p[][]=new int[n][n];
System.out.print("Input The Elements:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
p[i][j]=Integer.parseInt(br.readLine());
}
}
int sum,sum1;
sum=sum1=0;
int f=0;
int com=(int)(1*n*(Math.pow(n,2)+1))/2;
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
sum=sum+p[i][j];
sum1=sum1+p[j][i];
}
if((sum!=com)(sum1!=com))
{
f=1;
}
sum=0;
sum1=0;
}
if(f==1)
{
System.out.println("Not A Wondrous Square:");
}
else
{
System.out.println("wondrous Square:");
}
if(f==0)
{
int g=0,k;
System.out.println("Prime No.\t Row \t Index:");
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
{
for(k=1;k<p[i][j];k++)
{
if(p[i][j]%k==0)
{
g++;
}
}
if(g==1)
{
System.out.println(p[i][j]+"\t"+i+"\t"+j);
}
g=0;
}
}
}
}
}
Which programming language and development tools are used for developing Andorid applications?
Android applications are programmed using the Java programming language. While different tools exist, the most popular by far is the Eclipse IDE.
The Eclipse IDE is capable of installing extra bits of software called "plugins." Google produces a plugin called Android Development Tools (ADT.) This plugin makes development measurably easier. It also allows you to integrate your development more closely with the build processes and with the Android emulators.
What are the two types of data in scientific method?
Qualitative (things you can describe, like categories: gender or sport, variables like sm, m, and lg, or attitudes: agree/disagree, etc) and quantitative: things you can measure and report in numbers (like mass or volume)
The keyword "this" refers to the current class instance.
this.getName(); is used to call the getName() method of the current class. Ideally speaking just getName(); should be sufficient but still using the this keyword is a good practice.
You will find its use in case of inheritance and method overriding where you would have methods of the same name in both the current class and its parent. In such situations how can you specify which method to call?
You use the "this" keyword for the current class and the "super" keyword for the parent class.
Java allows you to play online games, chat with people around the world, calculate your mortgage interest, and view images in 3D, just to name a few. It's also integral to the intranet applications and other e-business solutions that are the foundation of corporate computing.
What is the difference between object oriented programming from text based programming?
An object-oriented program is made up of objects. An object has an internal state.Every object is an instance of (belongs to) a class.In simple terms a class is just a template for the object. It contains details of all the behaviour of an object along with what state information the object has. Text Programming:-Users want a Language that is more efficent, re-usable, easily maintainable, easy to read, and easy to write code in.
What is the value of a C Frame 38 SW special?
Smith & Wesson did not make a "C" frame, but they did use the 'C' prefix on various models made between 1948 and 1967. Value would depend on which model you have, originality and condition. sales@countrygunsmith.net
Write a program to eliminate the blanks from string 8085?
public class RemoveSpace{
public static void main(String args[]){
String str = "8085";
Sysytem.out.println(str.trim());
}
}
Get The Desired OutPut....
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 constructor will not allow subclasses to automatically use it.
This is implemented this way because of the special nature of constructors. Java could not always provide a default constructor because it could not guarantee that all class members would be properly created or initialized.
How to write java program without using main method?
We need a main method for executing a program.
But YES we can write a program without using main() method.
TRICK 1 of 2 :: while writing applets in java we don't use main... we use init() method instead.
TRICK 2 of 2 :: using 'static' we can write a program whic will execute successfully and output the desired message on screen. Here it is :: class Mohit{ static { System.out.println("This java program has run without the main method"); System.exit(0); } } -->save the program as Mohit.java to compile::javac Mohit.java (in command prompt) to run ::java Mohit(command prompt) output will be ::This java program has run without the main method
Whoa!!!!! we are done.
;)
Is array list a value type or reference type?
Array lists are objects and are of the reference data types. If you pass an array list from a java method to another as an argument, you need not return this from the target method because the modifications to the list would be happening in its value and hence would be available in the parent or calling method without being received as an output from the called method.