when running Eclipse, roughly 250k memory is used by it?In my Task Manager, it says: javaw.exe00265,000 KJava(TM) Platform SE binary.The value of 265,000 K is of course fluctuating, but around this value. Btw, this is when Eclipse is just running in the background, without even any java programs running in it. Is this normal memory usage by Eclipse?
it gives me an error at the end class part some syntax error insert "}"..
* Course: IT110 - Introduction to Programming * Filename: MyCustomShirtsPhase1.java * * Purpose: Created a simple online ordering system for My Custom Shirts customers */ import javax.swing.JOptionPane;
I and a friend are working with a project to create a file system, who manages a secondary memory simulated as a byte array in Java. We want the file system to be a hierarchical tree structure like in UNIX.
We have come quite far, but the paths are not handled correct. I seem to have mistaken the relative folder ./ for the root folder, but it should mean "working directory folder", ie, where I stand now. That is, if I stand in /dir1 as my "working directory" and make mkdir ./dir2 then should dir2 end up as subfolder in dir1. But with me it appears in the root.
So I'm trying to make a simple program which takes in an argument (target) and then looks through an ArrayList of strings. If it finds a string that begins with (target) then it will return the index of that string. If it doesn't find a string which begins with (target) then it will return -1 instead.
For some reason, the program is always returning -1, rather than the index of the string within the ArrayList when there is one which matches the search criteria.
Here is the code:
public int getIndex(ArrayList<String> text, String target) { int i = 0; int index = -1; boolean found = false;
I am trying to write a program that takes two numbers and multiplies them. I got this idea from this running conversion program
import java.util.Scanner; public class Convert { public static void main (String [] args) { Scanner reader = new Scanner (System.in); double farenheit; double celsius;
[code]...
i am getting a cant find symbol for the output = (alpha*beta) line..Also, am I using the reader object correctly ? hould I create two reader objects as there are 2 inputs needed?
I am trying to develop a new web application which takes in data from a form and stores data in a database.I have included all the three files join.jsp(the form which takes in data),reg.java(servlet) and JavaConncetDb(method which connects db and servlet). I get a 404 error when i try load the web application.
My file structure in eclipse
The error I am getting
join.jsp <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Write a method called largerAbsVal that takes two integers as parameters and returns the larger of the two absolute values. A call of largerAbsVal(11, 2) would return 11, and a call of largerAbsVal(4, -5) would return 5.
I have tried this code using methods in the Math Class but I am getting an error in Practice-it that says
Line 4 Your method's return type is void, which means that it does not return a value. But your code is trying to return a value. This is not allowed.
cannot return a value from method whose result type is void return Math.max(Math.abs(Num1), Math.abs(Num2));
Here is my code. What I am doing wrong?
public static void largerAbsVal (int Num1, int Num2) { return Math.max(Math.abs(Num1), Math.abs(Num2)); }
so i have this question where it wants me to create a recursion method that takes ONLY THE ARRAY as a parameter, and without using loops or static variables inside the method, and then the method returns the smallest value in that array. However, i tried making the simple if statements where i compare the first element of the array with the second element using the length of the array and decreasing it to get the next elements and compare it again by calling the recursion method, but the problem is when i call the method again, the length does not decrease, even if i store it in a variable, the variable will initialize itself again, and the length wont change.
I'm trying to make a simple Caesar cipher that takes in a String as the first argument and a integer shift as the second argument. Namely, there appears to be a problem with the loop and how I have declared the array - I want the converted characters to be put into a new array called newCharacterArray, converted back to a String and displayed in the command prompt window.
public class Caesar { public static void main(String inString, int k) { System.out.println("String: " + inString); char inStringArray[] = inString.toCharArray();
I'm having the hardest time getting a program to compile. I'm beginning to think I've downloaded the incorrect version of turtle graphics. This symbol looks foreign and I'm unsure how to find a solution. I have fixed some of the errors since this last picture but I will write out my code. The program takes a photo and converts to gray scale then to sepia
import images.APImages; import images.Pixel; import java.util.Scanner; public class sepia{ public static void main(String [] args){
I have a assignment to do some Lexigraphic ordering. I have figured how to get the majority of this done, however, when I input my string values. No output takes place? :s
import java.util.Scanner; public class Lab03c { public static void main(String[] args) { // TODO Auto-generated method stub Scanner lexi = new Scanner (System.in); String s1,s2;
i have to "Write a method called addToOverThirty which takes the array nums3 as a parameter. It adds 1 to all numbers that have a value greater than 30 in the array.
Add a call to the addToOverThirty method, then display a message telling what the output is followed by the results For example:The nums3 array after adding 1 to all numbers greater than 30 is10 6 15 and so on (check with the values you assigned to nums3)"its pointless because we were told not to make the array have a number over 30.
import java.lang.*; import java.util.*; public class LastProject public static void main(String[] args) { int nums1[] = new int[15]; int nums2[] = new int[15]; int nums3[] = {5,2,15,8,26,22,1,29,4,23,30,11,19,6,24};
Create a method called mirrorImage, which takes two integer arrays as input parameters. You may assume that the two actual parameters have the same length. Your method should return true if the arrays are the reverse of each other. Otherwise mirrorImage should return false.
Examples:
data1:{1,2,3} data2:{3,2,1} ==> true
[code].....
I'm pointing a place outside of the array or something
As you can see instead of displaying the champion name it is displaying the memory location and I do not know how to fix it.
class Champions { String name; Champions [] weak = new Champions [3]; Champions [] strong = new Champions [3]; String [] items = new String [3]; public static void main (String [] args) {
For some reason my code returns the memory address of the array when its a print statement with a string, but it works fine when its in a separate print statement all by itself. Why? Do I need to create a toString method that converts a char array to a String to something? The reason why I ask that is becuase on Eclipse line 10 has a warning stating "Must explicitly convert char[] to a String".
public class Ex { private String word; public Ex(String word) { this.word = word; } public char[] Display(){ char[] wordChars = this.word.toCharArray(); return wordChars;
[Code] .....
Result:
Hello world The word is: [C@1db9742
I also tried this, knowing that it's a long shot, but that didnt do anything...
public String toString(){ Ex ex = new Ex(this.word); char[] word = ex.Display(); String updated = word.toString();//counter intuitive? return updated; }
So I have that traditional memory game homework assignment and for some reason I can't figure out how to put the codes in order. I can't figure out the arrangement to make it work. So far I have
import java.util.Random; import java.util.Scanner; public class MemoryGame {
trying to write a program that takes a user inputted number and converts it to a binary number.
Here's what I have:
package com.java2novice.algos; import java.util.Scanner; public class Converter { static Scanner console = new Scanner(System.in); public void printBinaryFormat(int number){ int binary = console.nextInt();
I am to design a program in java that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas. I have tried but my results are wrong.
I have been struggling with this program for weeks. This program is supposed to take a user's inputted odd number and then print out all prime numbers lower than that number.
public class PrimeNumber { Scanner scan = new Scanner(System.in); int userNum; String neg;
I had a question about data structures. For the insert method of a linked list, the 'node' object is declared in the insert method. So doesn't the 'node' get destroyed as soon as the closing brace of the insert method is encountered? How do all the nodes continue to occupy memory?