How do you open a jar file on a mac?
You double-click on it.
You can indeed launch a jar file from the command line, with the following command:
java -jar yourfile.jar
As well as this you can assign "Jar Launcher" as the default app. to use when you double-click a jar file, as follows (I don't believe you need the developer tools installed for this):
Click once on the .jar file in the Finder and then from the menubar in the Finder select File -> Get Info". Click on "Open with" and from the popup menu select "Other". A file browser window will open. In this window, go to the /System/Library/CoreServices folder and select 'Jar Launcher'. Then make sure the "Always Open With" checkbox is checked and then click Add. Then click the "Change all" button so that any jar file will be opened automatically. Finally, close the Info window and now when you double-click any of your jar files they should run automatically.
Attributes and methods of uppercase in java?
In Java toUppercase() is a method of the class String: https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#toUpperCase()
What are the primary methods of programming?
The two primary methods of programming are procedural and object-oriented.
What is meant by input stream?
An input stream is a character sequence device or buffer from which input can be gathered. The standard input stream is usually a keyboard, data file or the output stream from another program. The user of the program can normally decide where standard input may be redirected from when launching the program, typically defaulting to the keyboard.
What the various types of assert methods and it purpose?
Suppose you assume that a number passed into a method (say, methodOne()) will never be negative. While testing and debugging, you want to validate your assumption, but you don't want to have to strip out print statements, runtime exception handlers, or if/else tests when you're done with development. But leaving any of those in is, at the least, a performance hit. Assertions to the rescue!
Assertions work quite simply. You always assert that something is true. If it is, no problem. Code keeps running. But if your assertion turns out to be wrong (false), then a AssertionError is thrown right then and there, so you can fix whatever logic flaw led to the problem. Assertions come in two flavors: really simple and simple, as follows: Really simple: private void doSomething() { assert (y > x); // more code assuming y is greater than x } Simple: private void doSomething() { assert (y > x): "y is " + y + " x is " + x; // more code assuming y is greater than x }
Can you access in drive class from base class private data?
Base class should no knowledge about derived classes.
The "private" modifier on a data member means private to the class which defined it. Base class cannot directly reference/access the private data member of the derived class, and the derived classes cannot access the private data member defined in the base class.
Either way the accessing the private data member should be done via properties or getters
The Client-Server Model
The most common model for distributing a system is the client-server model. The model is fairly simple to explain and use.
The name of the model is quite descriptive. In your distributed system you have one or more servers. These servers provide services to other parts of the system, called clients. When a server is started it first opens up a particular port through which clients can access it. It then sits down and waits until somebody (the client) attempts to connect to it. When that happens, the server and client exchange some messages and ultimately of the two close the connection. This connection takes place using so-called sockets.
*The Server*
The simplest version of such a server is non-threaded. That means that multiple connections are handled sequentially, in other words: clients have to queue up and they are handled one by one. That's fine if connections last only very short and if there are not too many clients connecting at the same time, however if you have many clients connecting at the same time or long-lasting connections you have to handle connections in parallel. You can handle multiple connections in parallel using threads. Each time a connection is established a new thread is created and the connection is handled by that new thread. The server thread then continues accepting new connections. Because creating threads is an expensive process (in terms of CPU cycles) threads are usually kept in a "pool". When a thread finished its job, it is kept alive until a new request has arrived it can handle.
*The Client*
For the client to connect it has to know the server's IP or hostname and the port to connect to. Once the connection is established the client and server can exchange messages. Depending on the distributed system a client may connect to multiple servers. One server to access the database, one for file services, another for e-mail, for example.
Regards
Dipak
siliguri
dipak_slg@rediffmail.com
C code on Reversing integer array elements using temporary variable?
#include <stdio.h>
int main()
{
int number, temp;
printf("enter the number");
scanf("%d",&number);
printf("\n reverse of %d",number);
while(number>0)
{
temp=temp*10+number%10;
number=number/10;
}
printf(" is %d",temp);
}
Write a java program to print the address of the study center?
public class Address
{
System.out.println(" The Address of Study Center is A-135, Model town")
}
What method of the string class removes all spaces from the beginning and end of a string object?
String a=" Suraj ";
String t=a.trim();
this will remove all the leading and trailing white spaces
The class case exception is thrown when an object A of class type B is cast to a class type C where C is neither B nor its subclass.
Difference between data abstraction and information hiding?
How do you write a working key listener in java that responds to an 'enter'?
Almost all controls' ActionListener triggers the actionPerformed upon the enter key press == == Using an anonymous class implementation:
Component c; // this is the component you want to add a listener to
c.addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) {
if(e.getKeyChar() == e.VK_ENTER) {
// put the code you want to execute when Enter is pressed here
System.out.println("ENTER PRESSED");
}
}
// unused abstract methods
public void keyTyped(KeyEvent e) {}
public void keyReleased(KeyEvent e) {}
});
Can an object be created from a main or non-main class?
please clarify the question. I have a feeling that the question is not asking what I am about to answer here.
You may have a class named "main" in the program.
I presume non-main means any class that is not main.
Can an object be created from a class (named main or non-main)? It depends on how you design that class. Ususally yes.
OLE Object
What is different between function and object in java?
a variable holds a single type of literal. i.e. 1, bat, 345. A object is a instance of a class created by the a programmer with a set of methods which preforms certain task depending what methods have been defined.
int a = 4; // a would be the variable
Car b = new Car();// b is an object
b.carGo();// this is an method in the object car created below.
class Car(){
void carGo(){
car moves;
}
}
How many types of database connectivity occur?
How many types of database connectivity occur? answer: well,There are several types of database 5 kinds considered to be under database types and 4 under the classification by location: n
-1 Single- user:
supports only one user at a time .
-2 desktop:
single=usere database running on a personal computer.
3-Multi-user:
supports multiple users at the same time such tat can be said as "network"where there are more than one computer at a time.
4- workgroup
Multi-user database that supports a small group of users or a single department.
5-Enterprise;
Multi-user database that supports a large group of users or an entire organization
Now is the classification by location database types:
1-centralized:
supports data located at a single site.
2-Distributed :
suporrts data distributed across several sites.
3-Transactional(or production):
supports a company's day to day operations.
4-data warehouse:
stores data used to generate information required to make tactical or strategic decisions.however,often used to store historical data as well as the structure database is quite different.
thanks for reading the artical.MY name is serag zentani if there is any inquire plz do contact me legend1977z@hotmail.com
How to Declare a variable that stores the cumulative sum java?
In Java:
You declare the variable like this:
int sum;
If you want to include decimals, change this to:
double sum;
To store an initial value, just use the assignment operator:
sum = 0;
You can combine this with the declaration:
double sum = 0.0;
To add something to the variable, for example the value of a variable called "x", use one of the following:
sum = sum + x;
sum += x;
In Java:
You declare the variable like this:
int sum;
If you want to include decimals, change this to:
double sum;
To store an initial value, just use the assignment operator:
sum = 0;
You can combine this with the declaration:
double sum = 0.0;
To add something to the variable, for example the value of a variable called "x", use one of the following:
sum = sum + x;
sum += x;
In Java:
You declare the variable like this:
int sum;
If you want to include decimals, change this to:
double sum;
To store an initial value, just use the assignment operator:
sum = 0;
You can combine this with the declaration:
double sum = 0.0;
To add something to the variable, for example the value of a variable called "x", use one of the following:
sum = sum + x;
sum += x;
In Java:
You declare the variable like this:
int sum;
If you want to include decimals, change this to:
double sum;
To store an initial value, just use the assignment operator:
sum = 0;
You can combine this with the declaration:
double sum = 0.0;
To add something to the variable, for example the value of a variable called "x", use one of the following:
sum = sum + x;
sum += x;
Need help with basic blueJ pizza program.?
Pizza class:
The Pizza class represents a pizza order. It has fields to store the customer's name, pizza size, number of toppings, and cost of the pizza. Write the Pizza class with these requirements:
A small pizza is $8, and toppings are $1 each.
A medium pizza is $10, and toppings are $2 each.
A large pizza is $12, and toppings are $3 each.
Additionally, if the customer orders 4 or more toppings, there is a $2 discount of the price of the pizza, regardless of the size.
This method will set the cost of the pizza.
Bales, medium 3-topping pizza: $16
Orders class:
The Orders class represents a number of orders for a pizza shop. It has 4 fields: three Pizza objects, and one String field that stores a day of the week.
Pizza orders for Wednesday
Bales, medium 3-topping pizza: $16
Marts, small 2-topping pizza: $10
Donal, large 6-topping pizza: $25
---------------------------------------
Total sales for Wednesday: $51
How do you create bar chart using java applet?
import java.awt.*;
import java.applet.*;
public class barChart extends Applet {
String label[];
int values[];
int n = 0;
public void init() {
try {
n = Integer.parseInt(getParameter("cols"));
label = new String[n];
values = new int[n];
label[0] = getParameter("label1");
label[1] = getParameter("label2");
label[2] = getParameter("label3");
label[3] = getParameter("label4");
values[0] = Integer.parseInt(getParameter("values1"));
values[1] = Integer.parseInt(getParameter("values2"));
values[2] = Integer.parseInt(getParameter("values3"));
values[3] = Integer.parseInt(getParameter("values4"));
} catch (NumberFormatException e) {
}
}
public void paint(Graphics g) {
g.setColor(Color.red);
for (int i = 0; i < n; i++) {
g.drawString(label[i], 100, 100 + i * 50);
g.fillRect(150, 80 + i * 50, values[i], 40);
}
}
}
<html>
<body>
<applet code="barChart.class" height="700" width="700">
<param name="cols" value="4" />
<param name="label1" value="1994" />
<param name="label2" value="1995" />
<param name="label3" value="1996" />
<param name="label4" value="1997" />
<param name="values1" value="110" />
<param name="values2" value="100" />
<param name="values3" value="190" />
<param name="values4" value="140" />
</applet>
</body>
</html>
What is object oriented para diagram?
There are two types of languages. Procedure oriented language and object oriented langugae.
An object oriented langugae is quite impresses from real world environment. it says that for example a classroom is full with chairs then that class is a class of object oriented and those chairs are object...
Basically this makes programing very easy and short...
Hope this answer was of some help...
What is the method for changing the default bullet list symbol?
select the list and choos ethr drop down arrow next to the bullets button to selcet the bullets library