87 Topics

Member Avatar for
Member Avatar for deshazer.jad

My goal is to create a clone of minesweeper. I've created a custon component that extends the JButton class, for each of the minesweeper buttons. I've called this new class SweeperButton. the game board is going to be made in another class by creating a two deminsional array of SweeperButtons, …

0
170
Member Avatar for Viped

Hi, I am trying to make simple gui which switches jpanel inside jframe but my IDE says "Cannot make static reference to non static method setPage(int) from the type Main". Why is that? There is no static modifier on actionPerformed or at setPage or actually anywhere else than public static …

Member Avatar for JamesCherrill
0
164
Member Avatar for gosensgo87

**Hello i am a noob when it comes to java so sorry if its obvious but the code below is giving me a error when i try to compile it, the error is: Exception in thread "main" java.lang.Error: Unresolved compilation problem: at goodcalculator.main(goodcalculator.java:127). Can anyone help me? ** CODE: import …

Member Avatar for JamesCherrill
0
302
Member Avatar for rahul.ch

Hey guys, I'm a starter so I had a doubt related to placement of a static variable. On line 5, for "static int d=5" compiler issues "illegal start of expression". But when I place it outside main() as Instance variable it works and prints "Hello 5". Why this thing? public …

Member Avatar for rahul.ch
0
198
Member Avatar for magg93

I'm really confused with this! I have 2 classes, Club and Membership. In Membership I have the method, getMonth(), and in Club I have joinedMonth() which takes the parameter, 'month' - so a user enters a month and then I want it to return the Membership's which joined in that …

Member Avatar for magg93
0
533
Member Avatar for Patiodude

I recently converted all my website's files to .php, including my index.html and 404 page. Everything worked fine until I clicked a dead link, and no 404 page came up. Naturally, I figured I forgot to update the .htaccess file. After doing so and re-uploading it, every page on my …

Member Avatar for |-|x
0
246
Member Avatar for sciwizeh

Hello all, been a while since I've asked a question. I'm working on a project just to practice and for fun and I've run into a snag. I'm working on a painting type program and I'm trying to get a generic Buffer class for the images so I can use …

Member Avatar for sciwizeh
0
2K
Member Avatar for maurya10

Can any1 help me in differentiating between dynamic and static scoping by using examples ??

Member Avatar for Rashakil Fol
0
97
Member Avatar for james chaco

Hi, I have created the following code to get connection object to Database(MySql in my case) using a static method. I wanna know whether it is a good practice or not? Will there be any problem like concurrent access? Any information will be helpful. public static Connection connection(){ Connection conn …

Member Avatar for SRocks
0
234
Member Avatar for surajrai

hi, I have two class say class A and class B. Now the methods in class B are used only by class A. When I checked class B, I found that few methods are static and few methods are internal. Can you sugest me is it fine ? Or since …

Member Avatar for skatamatic
0
236
Member Avatar for dwarvenassassin

For anyone working with ID3 version 1 or 1.1 tags in audio files, this static class may come in handy. It uses indexers to convert between the textual to the numerical representation or from numerical to textual and also accounts for unset and invalid values. Being static, it is always …

0
217
Member Avatar for crodriguez08

Hey, I get confused when dealing with the static scope and dynamic scope, and for this pseudocode I have to find both. For static I believe it should print out: 9 4 2 3 however, I'm not entirely sure. Any help would be appreciated, thanks. [CODE]Procedure main g:integer procedure B(a …

0
96
Member Avatar for belle_tenor

I am fairly new to C++ programming and have been working on an assignment for my C++ class that involves writing a dice rolling program (rolls 2 dice). The program is to get a random seed number and a desired number of rolls from the user, keep track of the …

Member Avatar for WaltP
0
696
Member Avatar for jt_4285

i am newbie to java.i am trying to run a program to show "static method" and "static variable ".my code is below.i am compling it on netbeans 7.01 and everytime i am getting the error.: "main method not found in class static_demo.Static_demo, please define the main method as: public static …

Member Avatar for stultuske
0
229
Member Avatar for warlord902

I have a static class, with all methods and fields static. My methods in that class are going to use a static field declared in that class. I want that static variable(which can not be made final) to be initialized with a value taken from a database when that static …

Member Avatar for warlord902
0
208
Member Avatar for warlord902

I have a kind of doubt, suppose I have a class like this: [CODE] public class AA{ public static createUser(String a, int b){ User usr=new User(a,b); BB.storeUser(usr); } } [/CODE] Now, if multiple threads call this createUser() method of this class at the same time, will it cause any kind …

Member Avatar for warlord902
0
188
Member Avatar for Staric

What I have is a linksys wrt54gs(dd-wrt) router assigning private ip's to my workstations. I also have a Windows Server which i need accessible for Windows Remote Desktop Connection to my remote office in Costa Rica. I'd like to have the server have one of my 5 static public ip's(so …

0
176
Member Avatar for sjcomp

Hello, I am using a singleton pattern, which works fine. But when I decided to have a singleton of a nested class that is privately declared. [CODE]class A : public CSingletonTmpl<A> { class B : public CSingletonTmpl<B> { }; }; A* CSingletonTmpl<A>::s_Singleton = NULL; A::B* CSingletonTmpl<A::B>::s_Singleton = NULL; [/CODE] The …

Member Avatar for madGambol
0
243
Member Avatar for Labdabeta

I am trying to make a static library using Code::Blocks and when I make a new static library project it generates a cpp file with functions encased with [ICODE]extern "C"[/ICODE] I am just wondering if this is necessary or if I can write the functions in normal c++ as well.

Member Avatar for vijayan121
0
130
Member Avatar for 5minutes

So I am supposed to write a class that converts fahrenheit to celsius (& vice versa), calculates the volume of a sphere after a radius is entered, and calculates the hypotenuse of a right triangle, all using nothing but static methods. Here is what I have so far; [CODE]class Fun …

Member Avatar for JeffGrigg
0
167
Member Avatar for Allander

Hi! I don't understand why I can't use my functions declared like this: [CODE]#include "groundArray.h" int groundArray::getlistX(int i) { return x; } int groundArray::getlistY(int i) { int groundlistY[] = {100, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100}; return groundlistY[i]; } int groundArray::getlistWidth(int i) { int groundlistWidht[] = …

Member Avatar for MonsieurPointer
0
211
Member Avatar for arjunpk

Hi, I have a program which has to do a lot of lookup. there are multiple threads running in parallel and all of these threads have to do a lookup on the same list of words. Currently i'm storing the list of words in a dictionary in each of the …

Member Avatar for Momerath
0
236
Member Avatar for hackit

i want to make a program that contains two main classes and they call each other. [CODE]class Main1 { public static void main(String arg[]) { for(int i=0;i<5;i++) System.out.println(i); Main2 m1=new Main2(); } } class Main2 { public static void main(String arg[]) { static int j=0; for(int i=0;i<5;i++) System.out.println(i); if(j==3) break; …

Member Avatar for hackit
0
178
Member Avatar for Alokkumar11
Member Avatar for Arkrothe

What will happen? Here's a code that i tried, it works but i don't really get what's actually happening or how many instances of the static test t are getting created. [CODE] #include<iostream> using namespace std; class Test { public: static Test t; void hello() { cout<<"this line shall be …

Member Avatar for Arkrothe
0
236
Member Avatar for AshfaqueIW

Hi all, I have a application which is completely written in C++. I got one review comment that normal class methods should not have any static variables and i am advised to move that variable inside class. I want to know what will be advantage of keeping the static variables …

Member Avatar for JasonHippy
0
226
Member Avatar for naffan

Hi all, I've been doing some reading about calling a non static variable or method from a static context, and almost but not quite have my head around what exactly is going on. I've read the text but can't seem to put that into context, so please bare with me. …

Member Avatar for naffan
0
618
Member Avatar for rizla777

Hey all Allright so here's what I'm trying to do. I'm trying to create about 6 pages into one page. They way that I want it to work is that I will have a navigation bar at the top which when one of the menu items when clicked will direct …

Member Avatar for twiss
0
137
Member Avatar for warlord902

I have some doubt regarding how class variable gets initialized, both static and non static. I mean, suppose I have a class like below. [CODE] public class MyClass{ public static HashMap<String,Buddy> buddiesMap= new HashMap<String,Buddy>(); public static ArrayList<String> buddiesList=new ArrayList<String>(); public static HashMap<String,ImageIcon> avatarMap=new HashMap<String, ImageIcon>(); public static ServerConnection con=new ServerConnection(); …

Member Avatar for thekashyap
0
533
Member Avatar for tracydo

Hi, I need help with some small exercises. I'll try my best to provide my code but these are ones that I don't know how. So... maybe you can help me with yours! Thanks 1. Question 1: A program contains the following method definition: [CODE] public static int cube(int num) …

Member Avatar for SMITA6076
0
507

The End.