32,204 Topics

Member Avatar for
Member Avatar for shelton22

Can any one convert this Java code to c++? import java.util.*; import java.io.*; public class Test { private static HashMap<String, List<String>> left_map_rights; public static void main(String args[]) throws Exception { left_map_rights = new HashMap<>(); BufferedReader r = new BufferedReader(new FileReader("routes.text")); String line; HashMap<String, Void> lines = new HashMap<>(); while ((line …

Member Avatar for Hiroshe
0
386
Member Avatar for Doogledude123

I'm trying to create a set of selectable labels, New Game, Load Game, Options, and Exit. I created a MenuItem class which extends Label, and set up the constructor to use the standard stuff expected from a Label. Here is the class. package com.irridium.echo.menu; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.scenes.scene2d.ui.Label; /** * …

Member Avatar for Galbatorix
0
671
Member Avatar for moaz.amin.37

there is my question that normally in java we create object with new operator but when we want to use String and String is also a class then we declare object without new operator why plz answer my question

Member Avatar for 203428
0
227
Member Avatar for Khan_1

import javax.swing.*; public class BankAccount { //======== fields (attributes, members)====== private String name; private String acctNo; private double balance; private final double MIN_BALANCE = 50; /** initialize all fields as default values */ public BankAccount() { name="N/A"; acctNo="00000"; balance=0; } /** initialize the fields @param n initializes name @param aNo …

Member Avatar for jwenting
0
455
Member Avatar for sasikrishnasamy

Hi to all, It’s one of the question in test, I am confused please someone help. MainClass{ Public static void main(String [] a){ Employee e=new Employee(); for(int i:e){ // Something } Now If I compile this code I will get an error. But without changing for each condition I want …

Member Avatar for jwenting
0
118
Member Avatar for moaz.amin.37

My code is not compile and run Code is Below import java.util.Scanner; class Input { public static void main(String arg[]) { int rno; System.out.print("Enter Your Name = "); System.in.nextInt(rno); } } i think if System.out.println() is run then upper code should have to run but not run please solve this …

Member Avatar for moaz.amin.37
0
550
Member Avatar for Asabre

Write a java application that uses random-number generation to create sentences. Use four arrays of strings called article, noun, verb and preposition. Create a sentence by selecting a word at random from each array in the following order: article, noun, verb, preposition, article and noun. As each word is picked, …

Member Avatar for JamesCherrill
0
462
Member Avatar for sing1006

i have 2 class for example class a and class b. i need the string store at class a pass and use by class b, here is my code for class a and class b. class a public void actionPerformed(ActionEvent arg0) { JFileChooser fileChooser = new JFileChooser(); fileChooser.setFileFilter(new FileNameExtensionFilter("Text Files", …

Member Avatar for iamthwee
0
310
Member Avatar for nutandevjoshi

COME ON I HEARD "YOU CAN SPECIFY WHAT CLASS SHOULD DO,NOT HOW".BUT WITHOUT INTERFACE ,EXTREME JAVA PROJECTS CAN BE MADE!! WHY TO MAKE COMPLICATION USING INTERFACE?

Member Avatar for iamthwee
-2
162
Member Avatar for TheFearful

I am new to Java and am experimenting with the language. I am looking a way to convert a user-inputted date and convert it to the MSexcel format. So 1998/07/05 is 35981. Any clue on how to do this? This is what I have so far import java.util.*; import java.text.*; …

Member Avatar for TheFearful
0
224
Member Avatar for moaz.amin.37

My question is that what is ".in" in system.in and i am not understandin the workin of System.in suppose Scanner obj=new Scanner(System.in); plz understand me the working of upper line.

Member Avatar for JamesCherrill
0
129
Member Avatar for masonketcham

I've got all my parts to inventory part 5 to compile successfully but when I go to run the program I get this message, I am unsure what to do. I know that it possibly means something to do with the image. I've checked the errors that came back and …

Member Avatar for stultuske
0
137
Member Avatar for xxmp

I opened a website business but i am programming at jsf mostly for big sites. Is there any good JAVA VPS or virtual Java server that i can buy because now i can not buy a server and set it up. Do you know any good one that i can …

Member Avatar for peter_budo
0
74
Member Avatar for souad

I have a lookup table that contains 2 columns k_id, keywords as follow k_id | keywords 1 | hi 2 | play and so on I want to create another table using the previous lookup table where I want to put the k_id values as the columns of the other …

0
92
Member Avatar for Slavi

Okay, so I have the following while(!connected){ if (details){ System.out.println("connected"); defaultHost = tfServer.getText(); defaultPort = Integer.parseInt(tfPort.getText()); program.run(); } System.out.println("Not connected"); } where details is true when a button is clicked. This works fine expect that my console is getting spammed by "Not connected" until I press the button and details …

Member Avatar for JamesCherrill
0
109
Member Avatar for Slavi

So, I've been making a gui for a client to connect to a server using it. What I want is when I press Login to connect with the specfied Server address and port name on the gui. If I have hardcoded the Server and port it works but I don't …

Member Avatar for Slavi
0
196
Member Avatar for sing1006

JMenuItem mntmLoad = new JMenuItem("Load"); mntmLoad.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent arg0) { JFileChooser chooser = new JFileChooser(); chooser.setMultiSelectionEnabled(true); int option = chooser.showOpenDialog(testgui.this); if (option == JFileChooser.APPROVE_OPTION) { File[] sf = chooser.getSelectedFiles(); String filelist = "nothing"; if (sf.length > 0) filelist = sf[0].getName(); for (int i = 1; i < …

Member Avatar for sing1006
0
796
Member Avatar for Halkawt.Papula

in below code , how can remove -1-1-1 ... in output this code a want output is equall 5 4 3 2 1 0 6 7 public class Homework3 { /** * smoosh() takes an array of ints. On completion the array contains the * same numbers, but wherever the …

Member Avatar for JamesCherrill
0
208
Member Avatar for Prabhat_1

encryption is one of the thing through which we can hide our file folder or anything else now we wanted that to encrypt a folder usin aes algorithm i have compressed the file how to encrypt file or folder

Member Avatar for Hiroshe
0
73
Member Avatar for Affable zaki

I am using upload services and i have to use a request over http due to which IE gives me "Mixed Content" popup. My client do not want this. Is there any way to hide or handle it through java script or in Jquerry or C#? Additional Info: Web Application …

Member Avatar for cgeier
0
157
Member Avatar for moaz.amin.37

Actually I have two questions 1) Why we not create Object with simple mathod like [(class name) (object name;)] in java 2) Why we use Constructor to create object code below class Run{} Run obj=new Run() why not use this code Run obj=new Run; Please relese my confusion

Member Avatar for Slavi
0
311
Member Avatar for cb1991110

I want the program to only allow integers at certain points. The code works but I have to enter a value twice then it skips a part of my code. My code is ` case 1: char ans; do{ Event event = new Event(); out.println("Please Enter the name of event"); …

Member Avatar for Doogledude123
0
224
Member Avatar for Violet_82

Hello, since I have realised how little I have understood of the GridBagLayout, I thought I'd open a thread where I could clarify one by one all my doubts. I have produced a very small and simple GUI which I will use to test the GridBagLayout and ask questions as …

Member Avatar for Violet_82
0
659
Member Avatar for mmm123

Hello, I am new to android development and this is my first time using eclipse so sorry if this question sounds silly. I have created an android application called IFMApp. I have four xml pages and 4 java classes. My application, is cleaning and building fine and will install to …

Member Avatar for peter_budo
0
313
Member Avatar for Netherblood

Hey there guys, I want to make a program that will track the number of times I have clicked a button. Thing is, I want this to write the information down and load it every time, so it doesn't start at 0 every time you start the program. How would …

Member Avatar for JamesCherrill
0
134
Member Avatar for SuperPink

Hello! I'm new to programming and I'm trying to do a basic hotel application using threads in java. Here is what i've already done: //room class public class Room { private int idRoom; private int etaj; private boolean empty; public Room() { this.idRoom = 0; this.etaj = 0; this.empty = …

Member Avatar for lalaRMa
0
2K
Member Avatar for pwolf

I am considering learning some server side stuff with java, however I am getting mixed views and opinions when searching. I read a benchmark that claims java has superior performance than most alternatives, and I was considering taking a look at grizzly or spring, but I really don't know too …

Member Avatar for Taywin
0
352
Member Avatar for Zsolt Szücs

I am a junior Java programmer trying to improve my knowledge in servlets. I have some experience in C++, PHP and SQL but mainly in small projects. It's nice to meet you guys.

Member Avatar for John_66
0
194
Member Avatar for vishalonne

Dear Experts When we create table in MS Access we enter description of field in description column. I am able to get the field name and data type from the table but how can I get the description from the table. Here is the code by which I am getting …

Member Avatar for vishalonne
0
301
Member Avatar for vgkarthi

Hi techies, I am new to webservices. The issue is regarding a SOAP request. The request contains a comment which has the charechter as "&" example., the comment is: You & me & is getting converted to "&amp;" in the receiver side. We tried getting the SOAP request (from our …

Member Avatar for vgkarthi
0
394

The End.