- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 11
- Posts with Upvotes
- 7
- Upvoting Members
- 8
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
23 Posted Topics
Build --> Build Solution (Hotkey: F7) Build --> Compile (Hotkey: Control+F7) And to run: Control+F5
Unfortunately I have an "on-line banking" project written in assembly. Do you want me to send you the code ?
1) Have you considered doing something like this: [CODE]package snip.swing.frame; import java.awt.Dimension; import java.awt.FlowLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JButton; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JPanel; public class Example extends JFrame implements ActionListener { /** Static data */ private static final int DIM_X = 300; private static final int DIM_Y …
Hello, regarding OOP I have Java background, and I usually think in java when I code OOP in python (which sometimes is actually a bad thing). [CODE=python]#!/usr/bin/python class Card(): SUIT = { 'C':'Clubs', 'D':'Diamonds', 'H':'Hearts', 'S':'Spades' } VALUES = { '2':2, '3':3, '4':4, '5':5, '6':6, '7':7, '8':8, '9':9, \ '10':10, …
[CODE]#include <stdio.h> #define PRINT_STRING(_s) printf("%s",_s) int main() { PRINT_STRING("string"); return (0); }[/CODE] You can also try this.
Check out the spelling. You've written: "Sytem", "Interger", "readLinne()". Afther that, leave Buffers (reading data input from the user is not as simple as it's in C or C++) alone for a while, and try to grasp the Java Basics.
A piece of working code: [CODE]#include <stdio.h> #include <stdlib.h> int mystrlen(char *s); char* reverse(char *s); int main() { char *string; string=(char*)malloc(sizeof(char)*50); printf("Enter string:"); scanf("%s",string); printf("Input string: %s \n",string); string=reverse(string); printf("Output String %s \n",string); return (0); } int mystrlen(char *s) { int i=0; while (s[i] != '\0') { i++; } return …
Your code is copy/paste. It's not even a valid C code.
Not another OS war topic... The history is repeating in every tech forum :).
As you can see the JOptionPane method returns a String. You cannot apply switch on String, so you must somehow "convert" that String in char. The charAt() method returns the first char in a String - exactly what you need. In C++ the String is probably already a char* :), …
Your problem description is very vague. Nobody will be able to help if you...
[CODE] function(pos1, pos2) { /* counter and size */ int i, s; /* first coresponding character */ char c; s = set as array size; c = array[pos1] (as a character) if (c equals the second coresponding character) { for every i smaller than array size (s) { /* Ternary …
If you choose to implement the ActionListener interface you should also override the actionPerformed(ActionEvent); method. ([URL="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/event/ActionListener.html"]java doc here[/URL]) [CODE]class Chapter165 extends JFrame implements ActionListener { //bla bla bla @Override public void actionPerformed(ActionEvent e) { // TODO Auto-generated method stub } }[/CODE] (I guess you should also include add a button …
Don't get me wrong, but Google is a wonderful tool for answering questions like yours: [URL="http://lmgtfy.com/?q=java+ftp+client"]Try this![/URL]
[QUOTE=javed123;994262]Hi , I have problem related to ArrayList...... ArrayList object may contain 1 or more ArrayList Objects and those inner ArrayList Object may contain 1 or more ArrayList Object and it is extendable to n levels. Condition is also added as ArrayList may contain different type of Objects too, i.e. …
It's very simple: ... the class Circle doens't have any [B]main[/B] method. So it's not an actual "program". You should use: [CODE]javac Circle.java TestCircle.java java TestCircle[/CODE] First line will compile both classes. Second line will run the class containing the main method. (don't skip the basics:P)
Try to create the process using the ProcessBuilder class: [CODE]ProcessBuilder pb= new ProcessBuilder(command); Process proc= pb.start();[/CODE] "command" is a list of Strings. For Windows it should look like this: [CODE]String[] command= { "cmd", "/C" , "dir" };[/CODE] Additional: After you create the output, you can obtain a stream of data …
[CODE]public class Factorial { public static int result=1; public static void getFactorial(int n){ if(n>0){ result*=(n--); getFactorial(n); } } public static void main(String args[]){ getFactorial(4); System.out.println(result); } }[/CODE] You can also try this solution if your number is positive.
What masijade was trying to say is to look at: [URL="http://java.sun.com/javase/6/docs/api/java/io/File.html"]class File[/URL] from the Java API. It's better to do that instead of: [CODE]if (os==windows) classname.runCommand(windows commands) else if (os==linux) classname.runcommand(linux command)[/CODE] If you want to make system dependent "command" calls, look at the [URL="http://java.sun.com/javase/6/docs/api/java/lang/ProcessBuilder.html"]class ProcessBuilder[/URL].
[QUOTE=leverin4;991676]How would I go about implementing the binary representation of the counter variable?[/QUOTE] If you don't write your own function (better do it!), use the built-in, [U]Integer.toBinaryString(int n)[/U].
Hello, I am a python newbie and I am trying to accommodate to the basics. What's the python equivalent for the following Java snippet ? [B]Java:[/B] [CODE]public class Main { public static void main(String args[]){ int a,b,c; a= (int) (Math.random()*100); c=0; while((b=(int)(Math.random()*100))!=a){ c+=1; } System.out.println(c); } }[/CODE] I was trying …
The End.
nomemory