+ 1
what are the data types explain with its examples
//Java Program to illustrate how to define a class and fields //Defining a Student class. class Student{ //defining fields int id;//field or data member or instance variable String name; //creating main method inside the Student class public static void main(String args[]){ //Creating an object or instance Student s1=new Student();//creating an object of Student //Printing values of the object System.out.println(s1.id);//accessing member through reference variable System.out.println(s1.name); } }
1 Respuesta
+ 3
Welcome to Sololearn.
You can learn about Java types in the beginner course.
https://www.sololearn.com/learn/courses/java-introduction