Re: [Linux-programlama] java'da static degisken , arguman kullanimi

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: Özcan GÜNGÖR (ozcangungor@gmail.com)
Date: Fri 16 Sep 2005 - 14:29:29 EEST


Test.arguman yerine this.arguman deseniz düzelir mi acaba?

On Fri, 2005-09-16 at 14:24 +0300, AHMET PEHLIVAN wrote:
> Merhaba ;
>
> Aşağıdaki gibi java kodum var. Bir arguman alıp try içinden
> kullanmak istiyorum. ( Dosya adı yerine vs )
>
> Argumanı print edince null alıyorum. ( Main içersinde print
> edersem problem yok )
>
> Yardımı olabilirseniz sevinirim.
>
> iyi çalışmalar.
>
> Ahmet
>
>
> *************************************************************************************************
> import java.io.*;
> public class Test
> {
> private static String arguman;
>
> public Test()
> {
> String sorgu = new String();
> try
> {
> System.out.println( Test.arguman );
>
> FileReader okuyucuNesne = new FileReader("/ahmet/sorgu.txt");
> BufferedReader tamponNesne = new BufferedReader(okuyucuNesne);
>
> String oku= tamponNesne.readLine();
> while (oku !=null )
> {
> sorgu=sorgu+oku;
> oku=tamponNesne.readLine();
> }
> }
>
> catch (FileNotFoundException except)
> {
> System.out.println("Sorgu Dosyasi yok.");
> }
> catch (IOException except)
> {
> System.out.println("Bir \"Exception\" olustu.");
> }
> String request = sorgu;
> System.out.println( request );
>
> }
> public static void main (String args[])
> {
> Test ssll=new Test();
> Test.arguman=args[0];
> }
> }
> *********************************************************************************************
>
> _______________________________________________
> Linux-programlama mailing list
> Linux-programlama@liste.linux.org.tr
> http://liste.linux.org.tr/mailman/listinfo/linux-programlama

_______________________________________________
Linux-programlama mailing list
Linux-programlama@liste.linux.org.tr
http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.