|
Why are you constantly posting same question in two different forums?
I have already posted the answer to your problem on your question, Can someone help me what I am doing wrong with this code?[^]. Read that thread.
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
public class tictok {
private int OO = 1;
private int XX = -1;
public int arr[] = new int[10];
public int getArrPos(int i,int j)
{
if (i==1) {
return j == 4?1:j==15?2:j==26?3:-1;
}
if (i==5) {
return j == 4?4:j==15?5:j==26?6:-1;
}
if (i==9) {
return j == 4?7:j==15?8:j==26?9:-1;
}
return -1;
}
public void printMap() {
for(int i=0;i<11;i++) {
for(int j=0;j<32;j++) {
if (i==3 || i==7) {
System.out.print("-");
continue;
}
if (j==10 || j==21) {
System.out.print("|");
continue;
}
if(getArrPos(i, j)!=-1){
if (arr[getArrPos(i, j)]== OO) {
System.out.print("O");
}else if (arr[getArrPos(i, j)]==XX) {
System.out.print("X");
}else {
System.out.print(getArrPos(i, j));
}
continue;
}
System.out.print(" ");
}
System.out.println();
}
}
public void play(int n,boolean isO)
{
if (n>9) {
System.out.println("silly B");
return;
}
arr[n]= isO?1:-1;
}
public static void main(String[] args) {
tictok tt = new tictok();
tt.play(8, true);
tt.play(6, false);
tt.printMap();
}
}
is it useful?
|
|
|
|
|
The driver has not received any packets from the server Some database interactions are successful and after that this Exception is raised…
I am using:
MYSQL 5.6
Netbeans IDE
MYSQL workbench
I had tried things like changing timeouts and other settings of MYSQL configuration but nothing is working....
|
|
|
|
|
Do you mean that Netbeans is throwing exceptions, or do you actually have some Java code involved?
|
|
|
|
|
Yes Java code is written to read data from MYSQL table process it and get output.This is my connection string:
String dburl = "jdbc:mysql://127.0.0.1,&autoReconnect=true&failOverReadOnly=false&maxReconnects=10:3306/project";
String driver = "com.mysql.jdbc.Driver";
String sUser = "root";
String sPwd = "root";
|
|
|
|
|
Where does the exception occur, and what is the information provided by it?
|
|
|
|
|
Exception is occurring after having some successful interactions with MYSQL database.
|
|
|
|
|
What is the exception message?
The sh*t I complain about
It's like there ain't a cloud in the sky and it's raining out - Eminem
~! Firewall !~
|
|
|
|
|
Afzaal Ahmad Zeeshan wrote: What is the exception message? He didn't clearly mark it as such, it's "The driver has not received any packets from the server"
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
If you didn't already do this, you should google for the exception message ("The driver has not received any packets from the server"). It shows several results; maybe you'll find the answer somewhere there.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
Hi,
I have a black white map to my city,
How can I make prog. to draw arrows from place x to place y "But not adirect one"
the arrows must drawed on the white "Rodes" Becouse black is "bildings"
Thanks;
|
|
|
|
|
|
How to implementation of Kruskal Algorithm in java?
|
|
|
|
|
Your question is not suitable for this forum because it is not a specific programming problem. Forum Guidelines - PLEASE READ[^]
Also, it isn't exactly hard to find information about this. When searching for "Kruskal Algorithm" Google returns 450k results, for "Kruskal Algorithm Java" 85k results.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
package week3rvsdsalesperson;
public class Week3rvsdSalesperson {
public static void main(String[] args) {
lic class week3rvsdsalesperson
private final double annualSalary = 40000.00;
private final double salesTarget = 120000;
private final double commissionRate = 5.0;
private double annualSales;
public week3rvsdsalesperson() {
annualSales = 0.0;
}
public week3rvsdsalesperson(double aSale) {
annualSales = aSale;
}
public double getAnnualSales(){
return annualSales;
}
public void setAnnualSales(double aSale) {
annualSales = aSale;
}
public double commission (){
double commission = 0;
if(annualSales>= (salesTarget*(80/100))) {
if(annualSales>= salesTarget){
commission = salesTarget * (commissionRate/100.0) + (annualSales- salesTarget)* (12.5/100.0);
}
else
commission = annualSales * (commissionRate/100.0);
}
return commission ;
}
public double annualCompensation (){
return annualSalary + commission();
}
}
}
}
|
|
|
|
|
lic class week3rvsdsalesperson
What is that supposed to be? It looks like you fell asleep over your keyboard or mouse.
|
|
|
|
|
|
Yes but at that position the whole line is just garbage. It's an out of place copy of the first line of the class, missing a "pub" at the start.
Also, your class is declared with a capital W but the constructors are written using a lower case w. One or the other has to be changed to make it consistent.
And the main-method seems to be missing a closing curly brace - and potentially some code in its body.
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson
|
|
|
|
|
|
i need Spring MVC with Hibernate Example for INSERT UPDATE DELETE VIEW as Web Application with XML Based Configuration in Eclipse.No need Annotation Config.
|
|
|
|
|
Hi all, I need a script I can run locally on a computer to pull a folder from google drive and save it to a specific location.
And I was wondering if anyone could point me in the right direction or if anyone has anything I can reverse engineer to get my head around it?
Thanks.
|
|
|
|
|
Does this have anything to do with Java?
By the way, this site does not provide code to order.
|
|
|
|
|
Because Java is the language I'd like to build it in. And I'm aware the site isn't going to provide code to order, hence I was asking for direction. Not a solution...
|
|
|
|
|
|
Following in google seems to produce many results
java google drive api example
|
|
|
|