NotesWhat is notes.io?

Notes brand slogan

Notes - notes.io

#CLASS
-- private (sadece o class)
-- procted (sadece o package)
-- public (HERKES)



// TODO işaretleme yapar sonradan bir şey yapacam anlamına gelir


----- Değişkeneler ----

byte byteDeger=127; // 8 bit. En küçük tam sayı tipi. -128 ile 127 arasında.
short shortDeger=45; // 16 bit. 32,767 ve -32,768
int intDeger=34; // 32 bit. 2.147.483.647 ile -2.147.483.648
long longDeger=54354l; // literal tanımlama 64 bit.



//Ondalıklı reel sayılar
float floatDeger=432.23f; // 32 bit.
double doubleDeger=532.4343d; //64 bit

//Karakterler
char a='A'; // Diğer dillerde char 8 bit ama java da 16 bit. Java nın karakter seti Unicode.
char b=34433;
b='v';

boolean durum=true; // Mantıksal ifadedir. 1 bit. Sadece true ya da false değer alır.


// final anahtar kelimesi sabit değişken tanımlamaya yarar. Değişken tipinin hemen önüne yazılır.

final String isim = "İsmet"; #bunu hiç bir şekilde kimse değiştiremez !!!


// kullanıcıdan veri alma için Scanner sınıfı.
Scanner scn=new Scanner(System.in);
System.out.println("Adınızı girin");
String metin= scn.next(); // nextLine
System.out.println("Hoşgeldiniz "+metin);

// Tip dönüşümü
int sayi= 10 ;
String sayi1 = String.valueOf(sayi) ; //Yol 1
String sayi2 = Integer.toString(sayi) ; //Yol 2
String sayi3 = sayi+" " ;

String ifade = "10" ;
int sayi11 = Integer.valueOf(ifade) ; //Yol 1
int sayi22 = Integer.parseInt(ifade) ;

double doubleSayi = 123.123d;
int intSayi = (int) doubleSayi;

long longSayi = 1234567;
float floatSayi = (float) longSayi;


--------------Kullanıcı Bilgi Almak-------------

Scanner scan = new Scanner(System.in);

=> Scannere Tıkla Aktar (import java.util.Scanner;)


X = scan.nextLine();

SAYI GİRMESİ İÇİN;

int b
b = scan.nextInt();


IgnoreCase Eklediğimizde Büyük Küçük Fark Yapmaz.

if(X.equalsIgnoreCase("Y"))
{
System.out.print("Merhaba Admin...");
}

//bir nevi isim == "Ismet" ama java da bu equals olarak oluyor
if(isim.equals("Ismet") == true)
{
}

public static void main (String args[])
{

}


public static int main (int a )
{
return a;
}

#ARRAYLAR
int[] = a;
a = new int[maxKRAKTER];

String[] = list = "Benim arabam var ".split(" ");
String[] admins = {"adam","mehmet"};

for(int i =0;i<admins.length;i++)
{
System.out.println(admins[i]);
}


#CLASSLAR

#abstract ve extends

public class kopek extends Hayvan {

int hiz;

public kopek(String isim,int yas,int hiz)
{
super(isim,yas);// DAİMA ÖNCE super olmalı (Hayvan->constract)
this.hiz = hiz;
}
public havla()
{
super.seslen("Hav Hav!");
}
public kos()
{
super.kos("4 ayak");
}

public void yuru(){#Mecburi Olması gerek

}

}

#abstract => Varsa bu class direk cağırılamaz bunun alt dizinini çağırmak gerek
Public abstract class Hayvan {

public abstract void yuru();#her alt classta yuru(); mecburu olacak !!

}


Hayvan o1 = new kopek("Karabaş",10,50);

#bir nevi classın köpek olduğunu tanımlıyoruz.
((kopek)o1).kos();


#interface

public interface className{

public void funcYaz();

}

#Functions

if(str1.compareTo(str2) < 0)
System.out.println( str1 + " alfabede "+ str2 +" den önde");




#Jframe

import javax.swing.JFrame;

Jframe pencere = new Jframe();

pencere.setSize(width,height);
pencere.setVisible(true);

#Jframe extend yap kolaylaştır. :)

import javax.swing.Jframe;
import java.awt.Graphics;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;


public class pencere extends Jframe implements MouseListener,KeyListener{


public pencere(){
super();
addMouseListener(this);
addKeyListener(this);
}

public void paint(Graphics g){
super.paint(g);

g.drawLine(x,y);
g.drawRect(x1,y1,x2,y2);

}

@Override
public void mouseClicked(MouseEvent e) {
// TODO Auto-generated method stub
// Mouse tıklandığı zaman
}

@Override
public void mouseEntered(MouseEvent e) {
// TODO Auto-generated method stub
// fare belli bir alana girince (tetik üzerinde durunca)

}

@Override
public void mouseExited(MouseEvent e) {
// TODO Auto-generated method stub
// belli bir alandan çıktığı zaman
}

@Override
public void mousePressed(MouseEvent e) {
// TODO Auto-generated method stub
//Belli bir tusa basılı tutarken
}

@Override
public void mouseReleased(MouseEvent e) {
// TODO Auto-generated method stub
// o tuşu bıraktığı zaman.
}

@Override
public void keyPressed(KeyEvent e) {
// TODO Auto-generated method stub
// kötü yanı tuş basılı iken sürekli yazar AAAAAAA gibi
}

@Override
public void keyReleased(KeyEvent e) {
// TODO Auto-generated method stub

}

@Override
public void keyTyped(KeyEvent e) {
// TODO Auto-generated method stub
// burada e.getKeyCode() Yani if(e.getKeyCode() == e.VK_DELETE){ } kullanılmıyor keyPresed e yaz

}
}



#Timer

#timer deki this hakkında
#class ek ekle implements ActionListener , this burada oluşan overvide yi temsil edip çalıştırır.

Timer timer = new Timer(1000,this);
timer.start();


#Jpanel

#Jpanel biraz daha yanıp sönmeyi kurtarıyor

Jframe pencere = new JFrame();
pencere.add(new Jpencere());
pencere.setSize(640,480);
pencere.setVisible(true);

class Jpencere extends Jpanel {

public void paintCompent(Garpichs g){
super.paintCompent(g);
}


#repaint(); Gene aynı

}
     
 
what is notes.io
 

Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...

With notes.io;

  • * You can take a note from anywhere and any device with internet connection.
  • * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
  • * You can quickly share your contents without website, blog and e-mail.
  • * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
  • * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.

Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.

Easy: Notes.io doesn’t require installation. Just write and share note!

Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )

Free: Notes.io works for 12 years and has been free since the day it was started.


You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;


Email: [email protected]

Twitter: http://twitter.com/notesio

Instagram: http://instagram.com/notes.io

Facebook: http://facebook.com/notesio



Regards;
Notes.io Team

     
 
Shortened Note Link
 
 
Looding Image
 
     
 
Long File
 
 

For written notes was greater than 18KB Unable to shorten.

To be smaller than 18KB, please organize your notes, or sign in.